Code edit (5 edits merged)
Please save this source code
User prompt
in MenuBoard, animateEntrance delay each col entrance by 200ms āŖš” Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (2 edits merged)
Please save this source code
User prompt
add logs in menuboard animateEntrance
Code edit (2 edits merged)
Please save this source code
User prompt
in animateEntrance, animate cells entrance from the right of the screen to their initial position (baseX; baseY) āŖš” Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 425
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 422
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 425
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 425
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 425
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 425
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 425
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 424
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting '0')' in or related to this line: 'self.menuGrid[row][col] = menuCell;' Line Number: 420
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
in resetButton.deactivate animate the button out to y=-300 āŖš” 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
do the same for resetbutton.activate āŖš” 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
in menubutton.activate() function animate entrance from y=-300 to y=130 āŖš” 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
User prompt
for levelText Animate scale to 10 and fade out; did not work, use w & h instead (store inital values before anim) āŖš” Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
===================================================================
--- original.js
+++ change.js
@@ -426,9 +426,11 @@
levelText.x = col * cellSize * 1.0 + cellSize / 2 - 90;
levelText.y = row * cellSize * 1.0 + cellSize / 4 + 10;
levelText.down = function (level) {
return function () {
- if (currentState != GAME_STATE.MENU) {
+ log("levelText currentState:", currentState, " isMenuReady=", isMenuReady); //{3F.2}
+ if (!isMenuReady) {
+ log("Menu not ready.", level); //{3F.2}
return;
}
log("Tapped level number:", level); //{3F.2}
if (level <= puzzleManager.maxReachedLevelNumber) {
@@ -539,8 +541,11 @@
};
self.disable = function () {};
self.enable = function () {};
self.activate = function () {
+ if (self.visible) {
+ return;
+ }
self.visible = true;
self.y = -300;
tween(self, {
y: 130
@@ -728,9 +733,17 @@
easing: tween.easeOut
});
};
self.deactivate = function () {
- self.visible = false;
+ tween(self, {
+ y: -300
+ }, {
+ duration: 500,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ self.visible = false;
+ }
+ });
};
self.highlight = function () {
tween(self, {
scaleX: 1.2,
@@ -1472,9 +1485,12 @@
tween(menuBoard, {
x: 0
}, {
duration: 1000,
- easing: tween.easeOut
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ isMenuReady = true;
+ }
});
menuButton.deactivate();
}
function handleMenuLoop() {
@@ -1483,8 +1499,9 @@
}
function cleanMenuState() {
// Clean up the game state for MENU
log("Cleaning MENU State");
+ isMenuReady = false;
// Animate menuBoard exit to the left side
tween(menuBoard, {
x: -2048
}, {
@@ -1964,8 +1981,9 @@
var levelNumberText;
var currentHighlightedTile;
var currentAdjacentTiles = []; // Initialize currentAdjacentTiles as a global variable
var dragNode = null;
+var isMenuReady = false;
var resetButton; // Declare resetButton as a global variable
var menuButton; // Declare menuButton as a global variable
var tileColors = {
0: 0xEAEEE8,
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