Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught Error: [object Object]addChildAt: The index undefined supplied is out of bounds 64' in or related to this line: 'boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index' Line Number: 1117
User prompt
Please fix the bug: 'Uncaught Error: [object Object]addChildAt: The index undefined supplied is out of bounds 9' in or related to this line: 'boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index' Line Number: 1115
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught Error: [object Object]addChildAt: The index undefined supplied is out of bounds 43' in or related to this line: 'boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index' Line Number: 1117
Code edit (2 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: 234
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught Error: [object Object]addChildAt: The index undefined supplied is out of bounds 43' in or related to this line: 'boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index' Line Number: 1114
Code edit (5 edits merged)
Please save this source code
User prompt
in ``` currentAdjacentTiles.forEach(function (adjTile) { adjTile.isHighlighted = true; tween(adjTile, { scaleX: 1.33, scaleY: 1.33 }, { duration: 200, easing: tween.easeOut }); }); ``` calculate the normalized distance to tile then use it to delay the scale anim
Code edit (1 edits merged)
Please save this source code
User prompt
create a new dedicated function for the code ``` currentAdjacentTiles.forEach(function (adjTile) { adjTile.isHighlighted = false; tween(adjTile, { scaleX: 1, scaleY: 1 }, { duration: 200, easing: tween.easeOut }); }); currentAdjacentTiles = []; // Clear the list after restoring scale ``` and use it
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: currentAdjacentTiles is not defined' in or related to this line: 'if (currentAdjacentTiles && currentAdjacentTiles.length > 0 && currentAdjacentTiles[0].value != tile.value) {' Line Number: 1055
Code edit (1 edits merged)
Please save this source code
User prompt
in handlePlayingStateMove, update the test `else if (tile.isHighlighted)` to also check if the tile is not in currentAdjacentTiles
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught Error: [object Object]addChildAt: The index undefined supplied is out of bounds 9' in or related to this line: 'boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index' Line Number: 1066
User prompt
Please fix the bug: 'Uncaught Error: [object Object]addChildAt: The index undefined supplied is out of bounds 9' in or related to this line: 'boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index' Line Number: 1064
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in handlePlayingStateUp , if currentAdjacentTiles, restore their scale to 0 with anim
User prompt
in handlePlayingStateMove store adjacentTiles list in a new global 'currentAdjacentTiles'
User prompt
when currentHighlightedTile is set, call getAdjacentTiles then animate their scale to 1.33 too
===================================================================
--- original.js
+++ change.js
@@ -1062,14 +1062,12 @@
});
}
} else if (tile.isHighlighted && !currentAdjacentTiles.includes(tile)) {
tile.isHighlighted = false;
- if (typeof tile.previousZIndex !== 'undefined') {
- boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index
- } else {
+ if (typeof tile.previousZIndex === 'undefined') {
tile.previousZIndex = boardContainer.getChildIndex(tile); // Set previousZIndex if undefined
- boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index
}
+ boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index
tween(tile, {
scaleX: 1,
scaleY: 1
}, {
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