Code edit (7 edits merged)
Please save this source code
User prompt
in cleanMenuState, animate the logo out to the left
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: tween is not defined' in or related to this line: 'tween(movingTile, {' Line Number: 1611 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (10 edits merged)
Please save this source code
User prompt
Ignore clicks before end of logo animation. use a global variable to track the enf of the anim
User prompt
Ignore clicks before end of logo animation
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
add a random rotation to flowers when spawning
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: finalScaleX is not defined' in or related to this line: 'if (flowerGraphics.scaleX < finalScaleX) {' Line Number: 62
User prompt
also when spawning Flower, make them grow in size from 0 to their final size
User prompt
when spawning Flower, make them fade in with an alpha anim from 0 to 1, (don't use tween for that)
Code edit (7 edits merged)
Please save this source code
User prompt
when spawning Flower, make them fade in with an alpha anim from 0 to 1
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -897,9 +897,9 @@
log("get Corner Horiz Anim rot=", rot, " / dir=", dir);
var normalWay = true;
switch (rot) {
case 0:
- normalWay = dir == 'lr' ? false : true;
+ normalWay = dir == 'lr' ? false : true; // dir == 'tb' ||
break;
case 1:
normalWay = dir == 'tb' ? false : true; //dir == 'rl' ||
break;
@@ -921,23 +921,15 @@
var currentProgress = reverted ? progress : progress - thirdSize * 2;
var normalWay = self.getCornerHorizontalAnimWay(self.pipeContainer.rot, self.pipeContainer.dir);
log("Upd Corner H: normal way:", normalWay);
log("Upd Corner H: Updated waterH width to:", currentProgress, " reverted=", reverted);
- /* DEFAULT WATER H :
- self.waterH = self.pipeContainer.attachAsset('waterH', {
- anchorX: 0,
- anchorY: 0.5,
- x: -5,
- y: -50,
- width: 0,
- height: 112,
- rotation: -Math.PI / 2,
- visible: false,
- dir: ''
- });
- */
if (normalWay) {
- self.waterH.tint = 0xF050A0;
+ //self.waterH.tint = 0xF050A0;
+ if (self.pipeContainer.rot == 0) {
+ self.waterH.y = -140;
+ self.waterH.x = -5;
+ self.waterH.rotation = -Math.PI / 2;
+ }
if (self.pipeContainer.rot == 1) {
self.waterH.y = -140;
self.waterH.x = -5;
self.waterH.rotation = -Math.PI / 2;
@@ -952,12 +944,9 @@
self.waterH.x = -5;
self.waterH.rotation = Math.PI / 2;
}
} else {
- self.waterH.tint = 0xFF0000;
- //self.waterH.y = -140;
- //self.waterH.x = -5;
- //self.waterH.rotation = -Math.PI / 2;
+ //self.waterH.tint = 0xFF0000;
if (self.pipeContainer.rot == 1) {
self.waterH.y = -90;
self.waterH.x = -3;
self.waterH.rotation = Math.PI / 2;
@@ -980,48 +969,8 @@
}
log("Upd Corner H: waterH position x:", self.waterH.x, "y:", self.waterH.y, "dir:", self.waterH.dir);
self.waterH.visible = true;
self.waterH.width = currentProgress;
- /*
- // 0
- if (Math.abs(self.pipeContainer.rotation) % (2 * Math.PI) < 0.1) {
- log("Upd Corner H: Case 0");
- self.waterH.rotation = (self.pipeContainer.rotation - Math.PI / 2) % (2 * Math.PI);
- self.waterH.tint = 0xF050A0;
- }
- // PI/2
- if (Math.abs(self.pipeContainer.rotation - Math.PI / 2) % (2 * Math.PI) < 0.1) {
- log("Upd Corner H: Case PI/2");
- // 3*PI/2 => Vers le haut
- // P/2 => => Vers le bas
- // PI => Vers la gauche
- // 0 => OK
- self.waterH.rotation = (self.pipeContainer.dir == 'rl' ? self.pipeContainer.rotation + Math.PI : self.pipeContainer.rotation) % (2 * Math.PI);
- self.waterH.tint = 0x00FF00;
- }
- // PI
- if (Math.abs(self.pipeContainer.rotation - Math.PI) % (2 * Math.PI) < 0.1) {
- log("Upd Corner H: Case PI; reverted=", reverted, " / self.pipeContainer.rotation=", self.pipeContainer.rotation);
- //self.waterH.rotation = (self.pipeContainer.rotation + Math.PI / 2) % (2 * Math.PI);
- self.waterH.rotation = (self.pipeContainer.dir == 'rl' ? self.pipeContainer.rotation - Math.PI / 2 : self.pipeContainer.rotation + Math.PI / 2) % (2 * Math.PI);
- self.waterH.y = -80;
- self.waterH.x = -5;
- self.waterH.tint = 0xFF0000;
- }
- // 3*PI/2
- if (Math.abs(self.pipeContainer.rotation - 3 * Math.PI / 2) % (2 * Math.PI) < 0.1) {
- log("Upd Corner H: Case 3*PI/2");
- // 3*PI/2 =>
- // P/2 =>
- // PI =>
- // 0 =>
- self.waterH.rotation = (self.pipeContainer.rotation + Math.PI) % (2 * Math.PI);
- self.waterH.y = -80;
- self.waterH.x = 0;
- self.waterH.tint = 0x00FF00;
- }
- log("Upd Corner H: waterH rotation is:", self.waterH.rotation);
- */
};
self.update = function () {
if (self.flow) {
if (!self.startFlowTicks) {
@@ -1718,9 +1667,9 @@
};
/****
* Game Variables
****/
-var debug = true;
+var debug = false;
function log() {
if (debug) {
console.log.apply(console, arguments);
}
@@ -1849,9 +1798,8 @@
tile.baseTile.alpha = 1;
LK.setInterval(function () {
if (tile.baseTile.alpha > 0) {
tile.baseTile.alpha -= alphaIncrement;
- tile.pipeContainer.alpha -= alphaIncrement;
}
}, 30);
}
});
@@ -1871,12 +1819,26 @@
flowers.push(flower);
game.addChild(flower);
}
}
+ // Animate all pipeContainer tiles' alpha from 1 to 0
+ puzzleManager.grid.forEach(function (row) {
+ row.forEach(function (tile) {
+ log("animate pipeContainer tile:", tile);
+ if (tile && tile.pipeContainer) {
+ tile.pipeContainer.alpha = 1;
+ LK.setInterval(function () {
+ if (tile.pipeContainer.alpha > 0) {
+ tile.pipeContainer.alpha -= alphaIncrement * 0.5;
+ }
+ }, 30);
+ }
+ });
+ });
// Animate growGrass alpha from 0 to 1
var grassAnimation = LK.setInterval(function () {
if (growGrass.alpha < 1) {
- growGrass.alpha += 0.05; // Adjust the increment for desired speed
+ growGrass.alpha += alphaIncrement; // Adjust the increment for desired speed
} else {
LK.clearInterval(grassAnimation);
LK.setTimeout(function () {
cleanPlayingState();
@@ -2143,8 +2105,11 @@
/****
* Event Handlers
****/
game.down = function (x, y, obj) {
+ if (logo && logo.y < 2732 / 2 - 50) {
+ return; // Ignore clicks if logo animation is not complete
+ }
switch (currentState) {
case GAME_STATE.MENU:
changeGameState(GAME_STATE.NEW_ROUND);
break;
@@ -2322,9 +2287,9 @@
}
/* 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 levelConfigs = {
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"]],
// Level 1
1: [["F-S-0", "", "", ""], ["F-V-0", "", "", ""], ["F-V-0", "", "M-H-0", ""], ["F-C-1", "F-H-0", "", "F-E-1"]],
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