User prompt
Please fix the bug: 'TypeError: butterflyGraphics.setFrame is not a function' in or related to this line: 'butterflyGraphics.setFrame(butterflyFrames[currentFrame]);' Line Number: 87
User prompt
Please fix the bug: 'TypeError: butterflyGraphics.setTexture is not a function' in or related to this line: 'butterflyGraphics.setTexture(LK.getAsset(butterflyFrames[currentFrame], {}).texture);' Line Number: 87
User prompt
create a new function playButterflyAnim similar to playPlumesAnim but for butterflies
User prompt
create a new class Butterfly that animates a butterfly using the 4 butterfly assets
Code edit (1 edits merged)
Please save this source code
User prompt
add a new function playPlumesAnim, that animates a plume asset randomly from right of the screen to the left. run it randomly like playAmbientSounds
User prompt
now include also birds3 in playAmbiantSounds
Code edit (13 edits merged)
Please save this source code
User prompt
add a new function playAmbiantSounds that randomly plays 'birds' or 'birds2'
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: storage is not defined' in or related to this line: 'self.currentLevel = storage.currentLevel || (debug && levelConfigs[0] ? 0 : 1);' Line Number: 1498 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Unable to load plugin: @upit/storage.v1' in or related to this line: 'var storage = LK.import("@upit/storage.v1");' Line Number: 55
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'tween is not defined' in or related to this line: 'tween(logoShadow, {' Line Number: 2264 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Unable to load plugin: @upit/tween.v1' in or related to this line: 'var tween = LK.import("@upit/tween.v1");' Line Number: 55
Code edit (1 edits merged)
Please save this source code
User prompt
``` LK.setTimeout(function () { game.removeChild(confetti); }, 1000); ``` solve the scope bug using a closure
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Reset the storage.currentLevel just before GameOver
Code edit (10 edits merged)
Please save this source code
User prompt
Use the storage plugin to store puzzleManager.currentLevel. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
===================================================================
--- original.js
+++ change.js
@@ -249,9 +249,9 @@
finalResultText.x = 50;
finalResultText.y = -1300;
finalResultText.alpha = 0.9;
finalResultText.visible = true;
- game.addChildAt(finalResultText, game.children.length - 1);
+ game.addChild(finalResultText);
tween(finalResultText, {
y: 400
}, {
duration: 1000,
@@ -270,16 +270,16 @@
});
finalResultText2.x = 50;
finalResultText2.y = 400;
finalResultText2.visible = true;
- game.addChildAt(finalResultText2, game.children.length - 1);
+ game.addChild(finalResultText2);
tween(finalResultText2, {
alpha: 1
}, {
- duration: 2000,
+ duration: 3000,
easing: tween.easeInOut
});
- }, 4000);
+ }, 7000);
}
function calculateStarsScore() {
log("Calculating stars score..."); // Log the start of the calculation
log("Current round moves:", currentRoundMoves); // Log current round moves
@@ -1444,9 +1444,9 @@
self.currentLevel++;
storage.currentLevel = self.currentLevel; // Store current level in storage
} else {
self.currentLevel = storage.currentLevel || (debug && levelConfigs[0] ? 0 : 1);
- self.currentLevel = debug ? 0 : self.currentLevel;
+ self.currentLevel = debug ? 15 : self.currentLevel;
}
self.isComplete = false;
};
self.initPuzzle = function () {
@@ -1944,8 +1944,10 @@
var waterDropInterval;
var waterFlowReachedEnd = false;
var logo;
var logoShadow;
+var logoMaze;
+var logoMazeShadow;
var puzzleManager;
var isLogoAnimInFinished = false;
var isLogoAnimOutFinished = false;
var isRoundExitAnimFinished = false;
@@ -2236,8 +2238,30 @@
});
logo.x = 2048 / 2;
logo.y = -logo.height; // Initialize logo out of screen
middleLayer.addChild(logo);
+ // logoMaze Shadow
+ logoMazeShadow = LK.getAsset('logoMaze', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ width: 1400,
+ height: 400,
+ tint: 0x000000,
+ alpha: 0.5
+ });
+ logoMazeShadow.x = 2048 / 2 + 20;
+ logoMazeShadow.y = -3000 + 20; // Initialize logo out of screen
+ middleLayer.addChild(logoMazeShadow);
+ // logoMaze
+ logoMaze = LK.getAsset('logoMaze', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ width: 1400,
+ height: 400
+ });
+ logoMaze.x = 2048 / 2;
+ logoMaze.y = -3000; // Initialize logo out of screen
+ middleLayer.addChild(logoMaze);
// Update any menu animations here
// Define a simple tween function to animate the logo
// Use the tween function to animate the logo
tween(logoShadow, {
@@ -2259,8 +2283,24 @@
onFinish: function onFinish() {
isLogoAnimInFinished = true;
}
});
+ tween(logoMaze, {
+ x: 2048 / 2,
+ // Center horizontally
+ y: 2732 - 450
+ }, {
+ duration: 2000,
+ easing: tween.bounceOut
+ });
+ tween(logoMazeShadow, {
+ x: 2048 / 2 + 20,
+ // Center horizontally
+ y: 2732 - 450 + 20
+ }, {
+ duration: 2000,
+ easing: tween.bounceOut
+ });
LK.getSound('logoBounce').play();
}
function handleMenuLoop() {}
function cleanMenuState() {
@@ -2294,8 +2334,38 @@
game.removeChild(logoShadow); // Remove logo from game
}
});
}
+ if (logoMaze) {
+ tween(logoMaze, {
+ x: -logoMaze.width
+ }, {
+ // Animate logo out to the left
+ duration: 1000,
+ // Duration of 1 second
+ easing: tween.easeInOut,
+ // Easing function for smooth animation
+ onFinish: function onFinish() {
+ logoMaze.visible = false; // Hide logo after animation
+ game.removeChild(logoMaze); // Remove logo from game
+ }
+ });
+ }
+ if (logoMazeShadow) {
+ tween(logoMazeShadow, {
+ x: -logoMazeShadow.width
+ }, {
+ // Animate logo out to the left
+ duration: 1000,
+ // Duration of 1 second
+ easing: tween.easeInOut,
+ // Easing function for smooth animation
+ onFinish: function onFinish() {
+ logoMazeShadow.visible = false; // Hide logo after animation
+ game.removeChild(logoMazeShadow); // Remove logo from game
+ }
+ });
+ }
}
function animateRoundEntrance() {
// Animate background images to slide to the left
tween(backgroundImage1, {
@@ -2815,59 +2885,71 @@
/* All Corners :
0: [["F-E-0", "F-C-2", "F-C-3", ""], ["F-C-1", "F-C-0", "F-C-1", "F-C-3"], ["F-C-2", "F-C-3", "F-C-2", "F-C-0"], ["F-S-2", "F-C-1", "", "M-C-0"]],
0: [["F-S-0", "F-C-2", "F-C-3", ""], ["F-C-1", "F-C-0", "F-C-1", "F-C-3"], ["F-C-2", "F-C-3", "F-C-2", "F-C-0"], ["F-E-2", "F-C-1", "", "M-C-0"]],
*/
-var nbLevels = 19;
+var nbLevels = 20;
var levelMinimalMoves = {
- 0: 16,
+ 0: 42,
1: 1,
2: 6,
3: 8,
4: 10,
- 5: 15,
- 6: 16,
- 7: 18,
- 8: 25,
- 9: 26,
- 10: 44,
- 11: 37,
- 12: 27,
- 13: 16,
- 14: 16,
- 15: 29,
- 16: 36,
- 17: 19,
- 18: 24,
- 19: 19
+ 5: 12,
+ 6: 15,
+ 7: 16,
+ 8: 16,
+ 9: 16,
+ 10: 16,
+ 11: 19,
+ 12: 24,
+ 13: 25,
+ 14: 26,
+ 15: 27,
+ 16: 29,
+ 17: 30,
+ 18: 36,
+ 19: 35,
+ 20: 38
};
var levelConfigs = {
- 0: [["F-E-3", "M-H-0", "M-C-2", "F-C-3"], ["", "", "F-C-2", "M-H-0"], ["M-H-0", "M-H-0", "M-C-0", ""], ["F-C-1", "M-H-0", "M-C-0", "F-S-1"]],
+ 0: [["F-S-0", "F-E-0", "M-C-0", "F-C-3"], ["F-V-0", "F-C-1", "", "M-C-2"], ["M-H-0", "M-V-0", "", "M-V-0"], ["F-C-1", "M-V-0", "F-H-0", "F-C-0"]],
// Level 1 - 1
1: [["F-S-0", "", "", ""], ["F-V-0", "", "", ""], ["F-V-0", "", "M-H-0", ""], ["F-C-1", "F-H-0", "", "F-E-1"]],
// Level 2 - 6
2: [["", "M-V-0", "F-E-0", ""], ["", "M-C-0", "F-V-0", ""], ["", "", "", ""], ["F-S-3", "F-H-0", "", ""]],
// Level 3 - 8
3: [["", "", "", ""], ["F-S-3", "F-C-3", "F-C-2", "F-E-1"], ["", "M-V-0", "F-V-0", ""], ["", "M-C-0", "M-C-1", ""]],
// Level 4 - 10
4: [["M-V-0", "F-C-2", "F-C-3", ""], ["M-C-1", "M-V-0", "F-V-0", "F-E-0"], ["F-S-0", "", "", "F-C-0"], ["F-C-1", "", "", "M-C-0"]],
- // Level 5 - 15
- 5: [["M-H-0", "", "M-V-0", "F-E-1"], ["", "", "", "M-H-0"], ["", "", "", ""], ["F-S-2", "", "M-V-0", "M-C-2"]],
- // Level 6 - 16
- 6: [["M-C-3", "F-C-2", "", ""], ["", "F-E-2", "", ""], ["", "", "", "F-V-0"], ["M-V-0", "M-H-0", "", "F-S-2"]],
- // Level 7 - 18
- 7: [["M-C-2", "M-H-0", "F-H-0", "F-E-1"], ["M-C-0", "", "", ""], ["M-H-0", "M-C-1", "M-C-3", ""], ["F-S-3", "F-H-0", "M-V-0", ""]],
- // Level 8 - 25
- 8: [["", "M-V-0", "M-H-0", "F-C-3"], ["", "F-S-0", "M-C-2", "F-E-2"], ["", "F-C-0", "", ""], ["M-H-0", "", "", "M-C-1"]],
- // Level 9 - 26
- 9: [["M-V-0", "F-C-2", "F-H-0", "F-C-3"], ["", "F-E-2", "", ""], ["", "M-V-0", "F-S-0", ""], ["", "M-C-1", "M-C-0", ""]],
- // Level 10 - 38
- 10: [["M-H-0", "", "", "F-S-1"], ["M-H-0", "F-V-0", "", ""], ["M-H-0", "F-C-0", "M-C-2", "M-C-2"], ["", "", "M-C-1", "F-E-1"]],
- 11: [["M-C-2", "M-H-0", "M-H-0", "M-C-3"], ["M-V-0", "", "", ""], ["F-E-0", "F-C-1", "F-S-1", ""], ["F-C-1", "M-C-0", "M-H-0", ""]],
- 12: [["M-C-2", "F-S-0", "", ""], ["M-C-1", "M-C-0", "", "F-V-0"], ["M-C-0", "F-C-2", "M-C-3", "F-V-0"], ["M-C-1", "F-E-2", "", "M-C-3"]],
- 13: [["F-S-3", "M-V-0", "F-C-3", "M-H-0"], ["", "", "", ""], ["", "", "", ""], ["F-E-3", "M-V-0", "F-C-0", "M-H-0"]],
- 14: [["M-C-2", "M-V-0", "M-V-0", "M-C-3"], ["M-V-0", "M-H-0", "M-H-0", "M-V-0"], ["M-C-1", "F-S-0", "F-E-0", "M-C-0"], ["", "F-C-0", "F-C-1", ""]],
- 15: [["M-H-0", "F-C-2", "", "F-C-3"], ["M-V-0", "F-E-2", "", ""], ["", "", "F-S-3", "M-C-0"], ["", "", "", ""]],
- 16: [["", "M-C-0", "M-C-1", ""], ["M-V-0", "F-V-0", "F-V-0", "M-V-0"], ["", "", "", ""], ["F-E-3", "M-C-2", "M-C-3", "F-S-1"]],
- 17: [["F-E-0", "M-V-0", "", "M-V-0"], ["M-H-0", "M-C-0", "", "F-S-0"], ["M-H-0", "", "", ""], ["F-C-1", "", "M-V-0", ""]],
- 18: [["F-S-0", "M-V-0", "M-C-3", "M-C-0"], ["F-C-1", "F-C-0", "M-C-2", "M-C-2"], ["F-E-0", "", "F-C-0", "M-C-1"], ["", "", "", ""]],
- 19: [["F-E-3", "M-H-0", "M-C-2", "F-C-3"], ["", "", "F-C-2", "M-H-0"], ["M-H-0", "M-H-0", "M-C-0", ""], ["F-C-1", "M-H-0", "M-C-0", "F-S-1"]]
+ // Level 5 - 12
+ 5: [["M-C-2", "M-H-0", "F-H-0", "F-E-1"], ["M-C-0", "", "", ""], ["M-H-0", "M-C-1", "M-C-3", ""], ["F-S-3", "F-H-0", "M-V-0", ""]],
+ // Level 6 - 15
+ 6: [["M-H-0", "", "M-V-0", "F-E-1"], ["", "", "", "M-H-0"], ["", "", "", ""], ["F-S-2", "", "M-V-0", "M-C-2"]],
+ // Level 7 - 16
+ 7: [["M-C-3", "F-C-2", "", ""], ["", "F-E-2", "", ""], ["", "", "", "F-V-0"], ["M-V-0", "M-H-0", "", "F-S-2"]],
+ // Level 8 - 16
+ 8: [["F-S-0", "F-E-0", "M-C-0", "F-C-3"], ["F-V-0", "F-C-1", "", "M-C-2"], ["M-H-0", "M-V-0", "", "M-V-0"], ["F-C-1", "M-V-0", "F-H-0", "F-C-0"]],
+ // Level 9 - 16
+ 9: [["F-S-3", "M-V-0", "F-C-3", "M-H-0"], ["", "", "", ""], ["", "", "", ""], ["F-E-3", "M-V-0", "F-C-0", "M-H-0"]],
+ // Level 10 - 16
+ 10: [["M-C-2", "M-V-0", "M-V-0", "F-C-3"], ["M-V-0", "M-H-0", "M-H-0", "M-V-0"], ["M-C-1", "F-S-0", "F-E-0", "M-C-0"], ["", "F-C-0", "F-C-1", ""]],
+ // Level 11 - 19
+ 11: [["F-E-0", "M-V-0", "", "M-V-0"], ["M-H-0", "M-C-0", "", "F-S-0"], ["M-H-0", "", "", ""], ["F-C-1", "", "M-V-0", ""]],
+ // Level 12 - 24
+ 12: [["F-S-0", "M-V-0", "M-C-3", "M-C-0"], ["F-C-1", "F-C-0", "M-C-2", "M-C-2"], ["F-E-0", "", "F-C-0", "M-C-1"], ["", "", "", ""]],
+ // Level 13 - 25
+ 13: [["", "M-V-0", "M-H-0", "F-C-3"], ["", "F-S-0", "M-C-2", "F-E-2"], ["", "F-C-0", "", ""], ["M-H-0", "", "", "M-C-1"]],
+ // Level 14 - 26
+ 14: [["M-V-0", "F-C-2", "F-H-0", "F-C-3"], ["", "F-E-2", "", ""], ["", "M-V-0", "F-S-0", ""], ["", "M-C-1", "M-C-0", ""]],
+ // Level 15 - 27
+ 15: [["M-C-2", "F-S-0", "", ""], ["M-C-1", "M-C-0", "", "F-V-0"], ["M-C-0", "F-C-2", "M-C-3", "F-V-0"], ["M-C-1", "F-E-2", "", "M-C-3"]],
+ // Level 16 - 29
+ 16: [["M-H-0", "F-C-2", "", "F-C-3"], ["M-V-0", "F-E-2", "", ""], ["", "", "F-S-3", "M-C-0"], ["", "", "", ""]],
+ // Level 17 - 32
+ 17: [["F-E-3", "M-H-0", "M-C-2", "F-C-3"], ["", "", "F-C-2", "M-H-0"], ["M-H-0", "M-H-0", "M-C-0", ""], ["F-C-1", "M-H-0", "M-C-0", "F-S-1"]],
+ // Level 18 - 36
+ 18: [["", "M-C-0", "M-C-1", ""], ["M-V-0", "F-V-0", "F-V-0", "M-V-0"], ["", "", "", ""], ["F-E-3", "M-C-2", "M-C-3", "F-S-1"]],
+ // Level 19 - 37
+ 19: [["M-C-2", "M-H-0", "M-H-0", "M-C-3"], ["M-V-0", "", "", ""], ["F-E-0", "F-C-1", "F-S-1", ""], ["F-C-1", "M-C-0", "M-H-0", ""]],
+ // Level 20 - 38
+ 20: [["M-H-0", "", "", "F-S-1"], ["M-H-0", "F-V-0", "", ""], ["M-H-0", "F-C-0", "M-C-2", "M-C-2"], ["", "", "M-C-1", "F-E-1"]]
};
\ No newline at end of file
straigth zenith view square light wooden pallet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
straigth zenith view square wooden pallet with big screws in each corner Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
simple yellow rating star. Modern video game style
tileSlide
Sound effect
levelWon
Sound effect
tileBlocked
Sound effect
fountain
Sound effect
waterInPipe
Sound effect
bgMusic
Music
logoBounce
Sound effect
levelStart
Sound effect
bgMusic2
Music
flowerPop
Sound effect
roundResult
Sound effect
gameWon
Sound effect
resetSound
Sound effect
birds
Sound effect
birds2
Sound effect
birds3
Sound effect