Code edit (3 edits merged)
Please save this source code
User prompt
add a new global showHintsInterval; then use it to delay gameHints.showHint1(); call by 1 sec
Code edit (21 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -2000,9 +2000,9 @@
}
}
function handlePlayingStateMove(x, y, obj) {
//log("Handling move event in PLAYING state", dragNode);
- if (dragNode && !isApplyingOperation) {
+ if (dragNode && !isAnimatingDragNode && !isApplyingOperation) {
// Calculate rotation based on x delta
var deltaX = x - dragNode.x; //{71.1}
var rotationFactor = -0.1; // Adjust this factor to control rotation sensitivity//{71.2}
var newRotation = deltaX * rotationFactor; //{71.3}
@@ -2087,9 +2087,9 @@
}
function handlePlayingStateUp(x, y, obj) {
// Implement logic for handling up event in PLAYING state
log("Handling up event in PLAYING state");
- if (dragNode) {
+ if (dragNode && !isAnimatingDragNode) {
// Check if the operation button is above a tile
var tileFound = false;
log("Operation dropped at ", x, y);
log("boardContainer at ", boardContainer.x, boardContainer.y);
@@ -2106,8 +2106,9 @@
if (!applied) {
log("Operation NOT applied. Cancel");
// Exit from loop
log("Restore canceled Operation...");
+ isAnimatingDragNode = true;
tween(dragNode, {
x: dragNode.baseX,
//rightOperationPreselectX,
y: dragNode.baseY,
@@ -2120,8 +2121,9 @@
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
dragNode = null;
+ isAnimatingDragNode = false;
isApplyingOperation = false;
}
});
return;
@@ -2141,8 +2143,9 @@
}); //{4x.1}
if (currentAdjacentTiles) {
resetAdjacentTilesScale();
}
+ isAnimatingDragNode = true;
tween(dragNode, {
alpha: 0
}, {
duration: 500,
@@ -2151,8 +2154,9 @@
if (dragNode) {
log("Destroy used Operation...");
dragNode.destroy();
dragNode = null;
+ isAnimatingDragNode = false;
isApplyingOperation = false;
}
}
});
@@ -2163,14 +2167,17 @@
// Exit from loop
return;
} else {
log("Operation button is NOT above tile at position:", tile.x, tile.y); // Log when operation button is not above a tile
- dragNode = null;
+ if (!isAnimatingDragNode) {
+ dragNode = null;
+ }
}
});
if (!tileFound) {
log("Operation button not above any tile");
LK.getSound('operationCancel').play();
+ isAnimatingDragNode = true;
tween(dragNode, {
x: dragNode.baseX,
//rightOperationPreselectX,
y: dragNode.baseY,
@@ -2180,9 +2187,12 @@
scaleX: 1,
scaleY: 1
}, {
duration: 500,
- easing: tween.easeOut
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ isAnimatingDragNode = false;
+ }
});
if (currentAdjacentTiles) {
currentAdjacentTiles.forEach(function (adjTile) {
adjTile.isHighlighted = false;
@@ -2263,8 +2273,9 @@
var rightOperationPreselectY = 2500;
var rightOperationPreselectR = -0.15;
var levelNumberText;
var isApplyingOperation = false;
+var isAnimatingDragNode = false;
var currentHighlightedTile;
var currentAdjacentTiles = []; // Initialize currentAdjacentTiles as a global variable
var showHintsInterval; // Declare showHintsInterval as a global variable
var gameHints; // Declare gameHints as a global variable
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