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
User prompt
in handlePlayingStateMove, when a tile isHighlighted store it in a new global currentHighlightedTile
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'getAdjacentTiles')' in or related to this line: 'tween(tile, {' Line Number: 710
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'getAdjacentTiles')' in or related to this line: 'tween(tile, {' Line Number: 691
User prompt
add a new function 'getAdjacentTiles' in puzzleManager the take a tile and returns all adjacent tiles with the same value
Code edit (11 edits merged)
Please save this source code
User prompt
in handlePlayingStateMove, Before highlighting, unhighlight other tiles
Code edit (1 edits merged)
Please save this source code
User prompt
don't set dragnode rotation directly but animate ir
Code edit (5 edits merged)
Please save this source code
User prompt
limit dragNode rotation between -0.1 and 0.1 and restore it to zero if deltaX is low
User prompt
during handlePlayingStateMove, Animate dragNode's rotation slightly depending on x delta
Code edit (1 edits merged)
Please save this source code
User prompt
``` tween(self.valueText, { scaleX: scaleRatio, scaleY: scaleRatio }, { duration: 500, easing: tween.easeOut }); ``` for self.valueText doesn't work with scale, try with width and height
Code edit (13 edits merged)
Please save this source code
User prompt
in preselect(), animate the movement and scale
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
in preselect(), use addChildAt to set the preselected operation front
Code edit (1 edits merged)
Please save this source code
User prompt
in updateOperations, preselect operation at index 0
Code edit (13 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -996,19 +996,8 @@
} //{71.8}
dragNode.x = x;
dragNode.y = y;
puzzleManager.board.forEach(function (tile) {
- if (tile.isHighlighted) {
- tile.isHighlighted = false;
- boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index
- tween(tile, {
- scaleX: 1,
- scaleY: 1
- }, {
- duration: 200,
- easing: tween.easeOut
- });
- }
if (isPointInsideTile(x, y, tile)) {
if (!tile.isHighlighted) {
tile.isHighlighted = true;
tile.previousZIndex = boardContainer.getChildIndex(tile); // Store previous z-index
@@ -1020,10 +1009,20 @@
duration: 200,
easing: tween.easeOut
});
// Play tick sound when a tile is highlighted
- //LK.getSound('tick').play();
+ LK.getSound('tick').play();
}
+ } else if (tile.isHighlighted) {
+ tile.isHighlighted = false;
+ boardContainer.addChildAt(tile, tile.previousZIndex); // Restore tile's original z-index
+ tween(tile, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 200,
+ easing: tween.easeOut
+ });
}
});
}
//log("Handling move event in PLAYING state");
@@ -1185,5 +1184,24 @@
foregroundLayer.addChild(resetButton);
// Transition to menu state
changeGameState(GAME_STATE.MENU);
}
-initializeGame();
\ No newline at end of file
+initializeGame();
+self.getAdjacentTiles = function (tile) {
+ var adjacentTiles = [];
+ var toCheck = [tile];
+ var checked = [];
+ while (toCheck.length > 0) {
+ var currentTile = toCheck.pop();
+ if (checked.includes(currentTile)) {
+ continue;
+ }
+ checked.push(currentTile);
+ currentTile.neighbors.forEach(function (neighbor) {
+ if (neighbor.value === tile.value && !checked.includes(neighbor)) {
+ adjacentTiles.push(neighbor);
+ toCheck.push(neighbor);
+ }
+ });
+ }
+ return adjacentTiles;
+};
\ No newline at end of file
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