Code edit (1 edits merged)
Please save this source code
User prompt
tween(logo, {...}) does nothing. please fix
User prompt
easing: tween.bounceOut doesn't exists so fix that line properly
User prompt
in initMenuState, init the logo out of screen, then in handleMenuLoop animate its entrace with a bounce anim and finish the anim at logo.x = 2048 / 2; logo.y = 2732 / 2 - 50;
User prompt
in handleMenuLoop use tween plugin to animate logo entrance in a bump anim ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
in initMenuState, move logo in middle layer
User prompt
Place it before the logo
User prompt
Add backgroundPlaying1 in menu state init too
User prompt
Play tileBlocked when player makes invalid move
User prompt
Play level when level solved
User prompt
Play tile slide when moving tile
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'includes')' in or related to this line: 'var baseTileAsset = type == 'start' || type == 'end' || puzzleManager && puzzleManager.levelConfigs && puzzleManager.levelConfigs[puzzleManager.currentLevel] && puzzleManager.levelConfigs[puzzleManager.currentLevel].fixedTiles.includes(x + ',' + y) ? 'baseTile' : 'baseMobileTile';' Line Number: 49
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'includes')' in or related to this line: 'var baseTileAsset = type == 'start' || type == 'end' || puzzleManager && puzzleManager.levelConfigs[puzzleManager.currentLevel].fixedTiles.includes(x + ',' + y) ? 'baseTile' : 'baseMobileTile';' Line Number: 49
Code edit (3 edits merged)
Please save this source code
User prompt
increment currentLevel when solved
User prompt
in reset, remove previous level tiles
Code edit (1 edits merged)
Please save this source code
User prompt
reset solved state in function initNewRoundState()
User prompt
in cleanPlayingState, reset elements of the animateSoil animation , ie: set gridBoardSoil not visible and alpha 0; hide grosGrass, etc
Code edit (5 edits merged)
Please save this source code
User prompt
Then in animateSoil, animate all tiles baseTile alpha from 1 to 0
User prompt
Please fix the bug: 'Uncaught ReferenceError: baseTileAsset is not defined' in or related to this line: 'self.baseTile = self.attachAsset(baseTileAsset, {' Line Number: 54
User prompt
in Tile class, replace var baseTileAsset by self.var baseTileAsset. Then in animateSoil, animate all tiles baseTileAssets alpha from 1 to 0
User prompt
in cleanPlayingState, remove remaining waterdrops if any
===================================================================
--- original.js
+++ change.js
@@ -19,14 +19,14 @@
self.rotation = 0;
// Methods
self.setType = function (type, x, y) {
self.type = type;
- self.baseTileAsset = type == 'start' || type == 'end' || puzzleManager && puzzleManager.levelConfigs[puzzleManager.currentLevel].fixedTiles.includes(x + ',' + y) ? 'baseTile' : 'baseMobileTile';
+ var baseTileAsset = type == 'start' || type == 'end' || puzzleManager && puzzleManager.levelConfigs[puzzleManager.currentLevel].fixedTiles.includes(x + ',' + y) ? 'baseTile' : 'baseMobileTile';
if (type == 'empty') {
return;
}
// Attach baseTile asset
- self.baseTile = self.attachAsset(self.baseTileAsset, {
+ self.baseTile = self.attachAsset(baseTileAsset, {
anchorX: 0.5,
anchorY: 0.5,
width: tileSize,
height: tileSize,
@@ -1013,20 +1013,25 @@
log("Animate soil...");
gridBoardSoil.visible = true;
gridBoardSoil.alpha = 0;
var alphaIncrement = 0.05; // Adjust the increment for desired speed
+ // Animate all baseTile tiles' alpha from 1 to 0
+ puzzleManager.grid.forEach(function (row) {
+ row.forEach(function (tile) {
+ if (tile.baseTile) {
+ tile.baseTile.alpha = 1;
+ LK.setInterval(function () {
+ if (tile.baseTile.alpha > 0) {
+ tile.baseTile.alpha -= alphaIncrement;
+ }
+ }, 50);
+ }
+ });
+ });
var soilAnimation = LK.setInterval(function () {
if (gridBoardSoil.alpha < 1) {
gridBoardSoil.alpha += alphaIncrement;
} else {
- // Animate all tiles baseTileAssets alpha from 1 to 0
- puzzleManager.grid.forEach(function (row) {
- row.forEach(function (tile) {
- if (tile.baseTile) {
- tile.baseTile.alpha = Math.max(0, tile.baseTile.alpha - alphaIncrement);
- }
- });
- });
LK.clearInterval(soilAnimation);
growGrass.visible = true;
// Animate growGrass alpha from 0 to 1
var grassAnimation = LK.setInterval(function () {
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