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
User prompt
when tapping a level in the menu, animate if scale to 10 and fade out (then restore it no inital values) āŖš” Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
User prompt
use storage plugin to store maxReachedLevelNumber āŖš” Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
Code edit (1 edits merged)
Please save this source code
User prompt
add logs in updateMenuGrid
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'levelText.style.fill = lvlColor;' Line Number: 471
Code edit (5 edits merged)
Please save this source code
User prompt
in updateMenuGrid Fore ach levelText in menuGrid, update the level color depending on puzzleManager.maxReachedLevelNumber
Code edit (3 edits merged)
Please save this source code
User prompt
fix ```levelText.down = function () { log("Tapped level number:", lvl); }; ```to take into account the scope
User prompt
in MenuBoard, add a down event handler on levelText elements and log the tapped level number
Code edit (2 edits merged)
Please save this source code
User prompt
in showWall() animate backgroundWall alpha from 0 to 1
Code edit (5 edits merged)
Please save this source code
User prompt
in cleanMenuState, animate menu exit to the left side
User prompt
in initMenuState, animate menuBoard entrance from the right side
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,9 @@
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
+var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
@@ -354,11 +355,11 @@
}
});
}
};
- self.setText = function (text) {
+ self.setText = function (text, text2) {
levelText.setText(text);
- levelText2.setText(text);
+ levelText2.setText(text2 || text);
};
// Method to show the level number
self.show = function () {
levelText.visible = true;
@@ -410,14 +411,16 @@
var lvlColor = isDone ? 0x6ad100 : 0xF93827;
lvlColor = notReached ? 0x787878 : lvlColor;
var levelText = new Text2(lvl < 10 ? "0" + lvl : lvl, {
size: 160,
- fill: lvlColor,
+ fill: 0xFFFFFF,
+ //lvlColor,
weight: 1000,
dropShadow: true,
dropShadowAngle: Math.PI,
dropShadowDistance: 10
});
+ levelText.tint = lvlColor;
levelText.lvl = lvl;
levelText.alpha = lvl <= puzzleManager.maxReachedLevelNumber ? 1 : 0.6;
levelText.blendMode = 2;
levelText.x = col * cellSize * 1.0 + cellSize / 2 - 90;
@@ -427,8 +430,9 @@
//{3F.1}
log("Tapped level number:", level); //{3F.2}
if (level <= puzzleManager.maxReachedLevelNumber) {
puzzleManager.selectLevel(level);
+ levelNumberText.setText(level, level + 1);
changeGameState(GAME_STATE.NEW_ROUND);
}
}; //{3F.3}
}(lvl); //{3F.4}
@@ -450,11 +454,11 @@
var notReached = lvl > puzzleManager.maxReachedLevelNumber;
var lvlColor = isDone ? 0x6ad100 : 0xF93827;
lvlColor = notReached ? 0x787878 : lvlColor;
log("Level color set to:", lvlColor.toString(16)); // Log the color being set
- levelText.setStyle({
- fill: lvlColor
- });
+ // levelText.setStyle({
+ // fill: lvlColor
+ // });
levelText.tint = lvlColor;
levelText.alpha = lvl <= puzzleManager.maxReachedLevelNumber ? 1 : 0.6;
log("Level alpha set to:", levelText.alpha); // Log the alpha value being set
}
@@ -912,9 +916,9 @@
self.levelBoardOffsetX = 0; // Initialize levelBoardOffsetX
self.levelBoardOffsetY = 0; // Initialize levelBoardOffsetY
self.currentLevel = debug ? 1 : 1;
self.previousLevelNumber = 1;
- self.maxReachedLevelNumber = 1;
+ self.maxReachedLevelNumber = storage.maxReachedLevelNumber || 1; // Retrieve from storage or default to 1
self.board = [];
self.operations = [];
self.isAnimating = false;
self.selectedOperation = null;
@@ -1306,10 +1310,11 @@
LK.setTimeout(function () {
self.previousLevelNumber = self.currentLevel;
self.currentLevel++; // Advance to the next level
if (self.currentLevel > self.maxReachedLevelNumber) {
- self.maxReachedLevelNumber = self.currentLevel;
- }
+ self.maxReachedLevelNumber = self.currentLevel; //{b6.1}
+ storage.maxReachedLevelNumber = self.maxReachedLevelNumber; // Store in storage
+ } //{b6.2}
changeGameState(GAME_STATE.NEW_ROUND); // Change state to newRound
}, 2000);
return true;
}
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