Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: isEnabled is not defined' in or related to this line: 'if (isEnabled) {' Line Number: 985
Code edit (5 edits merged)
Please save this source code
User prompt
in handlePlayingStateUp, find a way to exit the `puzzleManager.board.forEach` loop when operation is applied to a tile because `return`doesn't seem to work
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of null (reading 'type')' in or related to this line: 'var newValue = Math.max(0, currentTile.value + parseInt(operation.type));' Line Number: 1541
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2170 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2170 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2170 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2170 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2173 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2173 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2174 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(dragNode, {' Line Number: 2174 โช๐ก Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (15 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -442,8 +442,9 @@
levelText.setText(newLevel.toString());
levelText2.setText((newLevel + 1).toString());
} else {
levelText.setText("THE\nEND");
+ isOnLastScreen = true;
}
// Restore initial positions
levelText.x = centerX;
levelText.y = centerY;
@@ -1219,9 +1220,9 @@
self.game = game;
self.activeTileCount = 0; // Initialize active tile count
self.levelBoardOffsetX = 0; // Initialize levelBoardOffsetX
self.levelBoardOffsetY = 0; // Initialize levelBoardOffsetY
- self.currentLevel = debug ? 29 : 1;
+ self.currentLevel = debug ? 30 : 1;
self.previousLevelNumber = 1;
self.maxReachedLevelNumber = debug ? self.currentLevel : storage.maxReachedLevelNumber || 1; // Retrieve from storage or default to 1
self.board = [];
self.operations = [];
@@ -1590,9 +1591,17 @@
log("Tile already visited:", currentTile);
continue;
}
visited.push(currentTile);
- var operationType = operation ? parseInt(operation.type) : 0;
+ //var operationType = operation ? parseInt(operation.type) : 0;
+ var operationType = 0;
+ if (operation) {
+ if (operation.type == "ร2" || operation.type == "x2") {
+ operationType = currentTile.value;
+ } else {
+ operationType = parseInt(operation.type);
+ }
+ }
if (!operationType) {
log("Invalid operation !!!", operationType);
return;
}
@@ -2319,9 +2328,11 @@
// Score State Handlers
function handleScoreStateDown(x, y, obj) {
// Implement logic for handling down event in SCORE state
log("Handling down event in SCORE state");
- LK.showGameOver();
+ if (isOnLastScreen) {
+ LK.showGameOver();
+ }
}
function handleScoreStateMove(x, y, obj) {
// Implement logic for handling move event in SCORE state
//log("Handling move event in SCORE state");
@@ -2370,8 +2381,9 @@
var showHintsInterval; // Declare showHintsInterval as a global variable
var gameHints; // Declare gameHints as a global variable
var dragNode = null;
var isMenuReady = false;
+var isOnLastScreen = false;
var hasShowHint = false;
var resetButton; // Declare resetButton as a global variable
var menuButton; // Declare menuButton as a global variable
var tileColors = {
@@ -2543,9 +2555,13 @@
"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"]
+ "operations": ["-3", "-1", "-1", "-1", "-1"]
+ },
+ 30: {
+ "tiles": [["", "", "", 4, "", "", ""], ["", 2, 2, 4, 4, 3, 3], [1, 2, 4, 4, 4, 3, 1], ["", 1, 2, 4, 4, 3, 1], [1, 2, 4, 1, 4, 3, 1], ["", 4, 4, 1, 1, 4, 4], [4, 4, 1, 4, 1, 4, 4], ["", 1, 3, 4, 4, 2, 1], [1, 3, 2, 4, 3, 2, 1], ["", 1, 3, 2, 3, 2, 1], ["", 1, 3, 1, 2, 1, ""]],
+ "operations": ["-1", "-2", "+1", "-3", "ร2"]
}
};
/***********************************************************************************************/
/***************************************** 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