Code edit (25 edits merged)
Please save this source code
Code edit (25 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: Error: Invalid color format. Expected 0xRRGGBB format, received: undefined' in or related to this line: 'tween(tileGraphics, {' Line Number: 358 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (6 edits merged)
Please save this source code
User prompt
play bgMusic in loop
Code edit (1 edits merged)
Please save this source code
User prompt
create a new confetti class. use line asset. call it in playFinalAnimation
Code edit (1 edits merged)
Please save this source code
User prompt
add random tint to confettis
Code edit (4 edits merged)
Please save this source code
Code edit (18 edits merged)
Please save this source code
User prompt
in start fadeOut, add a delay in the foreach loop of 100*index for each letter
User prompt
in start fadeOut, add a LK.setTimeout in the foreach loop of 100*index for each letter
Code edit (4 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -1219,9 +1219,9 @@
self.game = game;
self.activeTileCount = 0; // Initialize active tile count
self.levelBoardOffsetX = 0; // Initialize levelBoardOffsetX
self.levelBoardOffsetY = 0; // Initialize levelBoardOffsetY
- self.currentLevel = debug ? 24 : 1;
+ self.currentLevel = debug ? 29 : 1;
self.previousLevelNumber = 1;
self.maxReachedLevelNumber = debug ? self.currentLevel : storage.maxReachedLevelNumber || 1; // Retrieve from storage or default to 1
self.board = [];
self.operations = [];
@@ -1241,10 +1241,9 @@
self.selectLevel = function (level) {
self.currentLevel = level;
self.previousLevelNumber = level;
};
- self.reset = function (noContinue) {
- gameHints.removeHint();
+ self.cleanAnimate = function () {
// Remove all existing tiles
self.board.forEach(function (tile) {
// Animate tiles moving randomly out of screen
tween(tile, {
@@ -1257,9 +1256,8 @@
tile.destroy();
}
});
});
- self.board = [];
// Remove all existing operations
self.operations.forEach(function (operation) {
// Animate operations moving randomly out of screen
tween(operation, {
@@ -1272,8 +1270,41 @@
operation.destroy();
}
});
});
+ };
+ self.reset = function (noContinue) {
+ gameHints.removeHint();
+ self.cleanAnimate();
+ // // Remove all existing tiles
+ // self.board.forEach(function (tile) {
+ // // Animate tiles moving randomly out of screen
+ // tween(tile, {
+ // x: Math.random() > 0.5 ? -200 - Math.random() * 1000 : 2248 + Math.random() * 1000,
+ // y: Math.random() > 0.5 ? -200 - Math.random() * 1000 : 2732 + Math.random() * 1000
+ // }, {
+ // duration: 800,
+ // easing: tween.easeIn,
+ // onFinish: function onFinish() {
+ // tile.destroy();
+ // }
+ // });
+ // });
+ self.board = [];
+ // Remove all existing operations
+ // self.operations.forEach(function (operation) {
+ // // Animate operations moving randomly out of screen
+ // tween(operation, {
+ // x: Math.random() > 0.5 ? -200 - Math.random() * 1000 : 2248 + Math.random() * 1000,
+ // y: Math.random() > 0.5 ? -200 - Math.random() * 1000 : 2732 + Math.random() * 1000
+ // }, {
+ // duration: 800,
+ // easing: tween.easeIn,
+ // onFinish: function onFinish() {
+ // operation.destroy();
+ // }
+ // });
+ // });
self.operations = [];
self.levelFailed = false;
// Load the current level
self.previousLevelNumber = self.currentLevel;
@@ -1804,8 +1835,9 @@
function initNewRoundState() {
// Initialize the game state for NEW_ROUND
log("Initializing NEW_ROUND State");
if (!levelConfigs[puzzleManager.currentLevel]) {
+ puzzleManager.cleanAnimate(); // in case of remaning tiles
changeGameState(GAME_STATE.SCORE);
return;
}
puzzleManager.initPuzzle();
@@ -2490,10 +2522,30 @@
"tiles": [["", "", "", "", "", "", ""], ["", "", "", 4, 4, "", ""], ["", "", 4, "", 4, "", ""], ["", "", 4, 2, 1, 4, ""], ["", 4, "", 3, "", 4, ""], ["", 4, 2, "", "", 3, 4], [4, "", 2, "", 3, "", 4], ["", 4, "", 1, 1, "", 4], ["", 4, 1, "", 1, 4, ""], ["", "", 4, 4, 4, 4, ""], ["", "", "", "", "", "", ""]],
"operations": ["-2", "-1", "-1", "+1", "+1", "+1"]
},
24: {
- "tiles": [["", "", "", "", 2, "", 3], ["", "", 2, "", 2, 3, 3], ["", 2, "", 3, 3, "", ""], ["", "", 2, 3, "", 2, ""], [3, 3, 2, "", 2, 3, 3], ["", "", 2, "", 3, 3, ""], ["", "", 2, 3, "", 2, ""], ["", 3, 3, 2, "", 2, 3], ["", "", "", 2, 3, 3, 3], ["", "", "", 3, 2, "", 2], ["", 3, 3, "", 2, "", 2]],
- "operations": ["-2", "-1", "+1"]
+ "tiles": [["", "", "", "", 2, "", 1], ["", "", 2, "", 2, 1, 1], ["", 2, "", 1, 1, "", ""], ["", "", 2, 1, "", 2, ""], [1, 1, 2, "", 2, 3, 3], ["", "", 2, "", 3, 3, ""], ["", "", 2, 3, "", 2, ""], ["", 3, 3, 2, "", 2, 3], ["", "", "", 2, 3, 3, 3], ["", "", "", 3, 2, "", 2], ["", 3, 3, "", 2, "", 2]],
+ "operations": ["-2", "-1", "-1", "+1", "+1"]
+ },
+ 25: {
+ "tiles": [["", "", "", "", "", "", ""], ["", 4, 4, 4, 2, 1, 2], [4, 4, 4, 2, 2, 2, ""], ["", 2, 4, 2, 2, 2, ""], ["", 2, 4, 2, 2, "", ""], ["", "", 2, 2, "", "", ""], ["", "", "", 4, 3, 3, ""], ["", 1, 1, 3, 3, 1, 3], [1, 1, 3, 3, 3, 1, 3], ["", 1, 3, 3, 3, 1, 1], ["", 3, 1, 3, 1, 1, ""]],
+ "operations": ["-2", "-1", "-1", "-1", "+1"]
+ },
+ 26: {
+ "tiles": [["", "", "", 1, 1, 1, ""], ["", "", "", "", "", 1, ""], ["", "", "", "", 4, 1, 1], ["", "", 3, 3, 3, "", 1], ["", "", "", 3, "", "", ""], ["", "", "", 4, 3, 3, ""], [2, 2, 2, "", 3, "", ""], ["", "", 2, "", "", "", ""], ["", 4, 2, 2, "", "", ""], ["", "", "", 2, "", "", ""], ["", "", 2, "", "", "", ""]],
+ "operations": ["-2", "-1", "-1", "+1", "+2"]
+ },
+ 27: {
+ "tiles": [["", "", "", "", "", "", ""], ["", "", "", 1, 1, 3, ""], ["", "", 1, 1, 3, 3, ""], ["", "", 1, 1, 3, 3, 3], ["", 2, 2, 2, 3, 3, 1], ["", 2, 2, 2, 4, 3, 1], [2, 2, 2, 4, 4, 1, ""], ["", "", 1, 3, 3, 1, ""], ["", "", 1, 3, 1, "", ""], ["", "", "", 1, 1, "", ""], ["", "", "", 1, "", "", ""]],
+ "operations": ["-2", "-1", "+2", "-1"]
+ },
+ 28: {
+ "tiles": [["", 2, 2, 2, 2, 2, ""], ["", 2, 3, 4, 4, 3, 2], [2, 2, 2, 2, 2, 2, 2], ["", 2, 3, 1, 1, 3, 2], [2, 2, 2, 2, 2, 2, 2], ["", 2, 3, 1, 1, 3, 2], [2, 2, 2, 2, 2, 2, 2], ["", 2, 3, 4, 4, 3, 2], [2, 2, 2, 2, 2, 2, 2], ["", 2, 2, 2, 2, 2, 2], ["", "", "", "", "", "", ""]],
+ "operations": ["-2", "-1", "-1", "+2"]
+ },
+ 29: {
+ "tiles": [["", 3, 4, "", 3, 3, ""], ["", 1, 3, 4, "", 3, 2], [1, 1, 4, "", 3, 2, 2], ["", 1, 3, 4, "", 3, 2], [3, 3, 4, "", 3, 3, 3], ["", 3, 3, 4, 3, 3, 3], [3, 3, 4, "", 3, 3, 3], ["", 2, 3, 4, "", 3, 1], [2, 2, 3, "", 3, 1, 1], ["", 2, 3, 4, "", 3, 1], ["", 3, 4, "", 3, 3, ""]],
+ "operations": ["-1", "-1", "-3", "-1", "-1"]
}
};
/***********************************************************************************************/
/***************************************** GAME INITIALISATION *********************************/
tick
Sound effect
tileEntrance
Sound effect
tileRemove
Sound effect
operationSelect
Sound effect
operationCancel
Sound effect
tileChangeValue
Sound effect
resetSound
Sound effect
levelFailed
Sound effect
menuLevelSelect
Sound effect
menuCellEnter
Sound effect
applause
Sound effect
bgMusic
Music
tada
Sound effect