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
@@ -1487,9 +1487,9 @@
self.updateOperations();
self.fillTilesNeighbors();
log("applyOperation... Ok applied done:");
self.isAnimating = false; // Reset animating flag after operation is done
- }, 600);
+ }, 3000);
return true;
};
self.propagateOperation = function (operation, startTile) {
var visited = [];
@@ -1926,9 +1926,10 @@
// Implement logic for handling down event in PLAYING state
log("Handling down event in PLAYING state", obj);
puzzleManager.operations.forEach(function (operation) {
//operation.isSelected &&
- if (x >= operation.x - operation.width / 2 && x <= operation.x + operation.width / 2 && y >= operation.y - operation.height / 2 && y <= operation.y + operation.height / 2) {
+ if (!dragNode && !isApplyingOperation && x >= operation.x - operation.width / 2 && x <= operation.x + operation.width / 2 && y >= operation.y - operation.height / 2 && y <= operation.y + operation.height / 2) {
+ log("Ok Dragging operation ", operation);
dragNode = operation;
tween(operation, {
rotation: 0,
scaleX: 0.6,
@@ -1994,9 +1995,9 @@
}
}
function handlePlayingStateMove(x, y, obj) {
//log("Handling move event in PLAYING state", dragNode);
- if (dragNode) {
+ if (dragNode && !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}
@@ -2093,13 +2094,32 @@
return;
} // Exit loop if operation is applied
log("Checking tile at position:", tile.x, tile.y); // Log tile position
if (isPointInsideTile(x, y, tile)) {
+ isApplyingOperation = true;
log("Operation button is above tile at position:", tile.x, tile.y); // Log when operation button is above a tile
var applied = puzzleManager.applyOperation(dragNode, tile);
if (!applied) {
log("Operation NOT applied. Cancel");
// Exit from loop
+ log("Restore canceled Operation...");
+ tween(dragNode, {
+ x: dragNode.baseX,
+ //rightOperationPreselectX,
+ y: dragNode.baseY,
+ //rightOperationPreselectY,
+ rotation: dragNode.baseR || 0,
+ //rightOperationPreselectR,
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 500,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ dragNode = null;
+ isApplyingOperation = false;
+ }
+ });
return;
}
operationApplied = true; // Set flag to true when operation is applied
tileFound = true;
@@ -2123,9 +2143,12 @@
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
if (dragNode) {
+ log("Destroy used Operation...");
dragNode.destroy();
+ dragNode = null;
+ isApplyingOperation = false;
}
}
});
if (puzzleManager.currentLevel == 1 && gameHints.hasShowHint == 2) {
@@ -2135,8 +2158,9 @@
// 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 (!tileFound) {
log("Operation button not above any tile");
@@ -2167,9 +2191,8 @@
});
currentAdjacentTiles = []; // Clear the list after restoring scale
}
}
- dragNode = null;
} else {
puzzleManager.board.forEach(function (tile) {
tile.isHighlighted = false;
if (typeof tile.previousZIndex === 'undefined') {
@@ -2234,8 +2257,9 @@
var rightOperationPreselectX = centerX + 650;
var rightOperationPreselectY = 2500;
var rightOperationPreselectR = -0.15;
var levelNumberText;
+var isApplyingOperation = 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