Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
make water height anim faster
Code edit (4 edits merged)
Please save this source code
User prompt
make height anim faster
User prompt
change height sin anim into a linear anim
Code edit (1 edits merged)
Please save this source code
User prompt
along with tint anim add a height anim
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
change the sin anim by something more linear
Code edit (1 edits merged)
Please save this source code
User prompt
change alpha animation by a tint animation from black to white
Code edit (12 edits merged)
Please save this source code
User prompt
add an update function in Tint class. if self.water1 and self.water2 aren't null, animate their alpha with sin function
Code edit (1 edits merged)
Please save this source code
Code edit (19 edits merged)
Please save this source code
User prompt
in Tile.setType, use baseMobileTile instead of baseTile for types straightPipeH, straightPipeV and cornerPipe
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
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'width')' in or related to this line: 'self.baseTile.width = tileSize;' Line Number: 96
Code edit (1 edits merged)
Please save this source code
User prompt
even a junior dev won't fix a bug by doing ``` self.width = self.width; self.height = self.height; ``` Please take it seriouly
User prompt
please ensure that
===================================================================
--- original.js
+++ change.js
@@ -5,8 +5,10 @@
// Define a Tile class to represent each tile in the grid
var Tile = Container.expand(function () {
var self = Container.call(this);
self.type = 'empty'; // Default type
+ self.baseTint = 0x8FBE00;
+ self.baseTintLight = 0x5ED000;
self.connections = []; // Connection points for pipes
self.position = {
x: 0,
y: 0
@@ -35,23 +37,26 @@
self.attachAsset('startTile', {
anchorX: 0.5,
anchorY: 0.5,
x: 20,
- y: 55
+ y: 55,
+ tint: self.baseTint
});
self.attachAsset('vane', {
anchorX: 0.5,
anchorY: 0.5,
x: 20,
- y: 15
+ y: 15,
+ tint: self.baseTint
});
break;
case 'end':
self.attachAsset('endTile', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
- y: 55
+ y: 55,
+ tint: self.baseTint
});
break;
case 'fixed':
// self.attachAsset('fixedPipe', {
@@ -60,60 +65,83 @@
// });
self.attachAsset('straightPipe', {
anchorX: 0.5,
anchorY: 0.5,
- y: -40
+ y: -40,
+ tint: self.baseTint
});
self.attachAsset('straightPipe', {
anchorX: 0.5,
anchorY: 0.5,
scaleY: -1,
- y: 30
+ y: 30,
+ tint: self.baseTint
});
self.attachAsset('straightPipeV', {
anchorX: 0.5,
anchorY: 0.5,
- x: -30
+ x: -30,
+ tint: self.baseTint
});
self.attachAsset('straightPipeV', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: -1,
- x: 30
+ x: 30,
+ tint: self.baseTint
});
break;
case 'straightPipeH':
self.attachAsset('straightPipe', {
anchorX: 0.5,
anchorY: 0.5,
- y: -40
+ y: -40,
+ tint: self.baseTint
});
self.attachAsset('straightPipe', {
anchorX: 0.5,
anchorY: 0.5,
scaleY: -1,
- y: 30
+ y: 30,
+ tint: self.baseTint
});
break;
case 'straightPipeV':
self.attachAsset('straightPipeV', {
anchorX: 0.5,
anchorY: 0.5,
- x: -30
+ x: -30,
+ tint: self.baseTint
});
self.attachAsset('straightPipeV', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: -1,
- x: 30
+ x: 30,
+ tint: self.baseTint
});
+ // Water
+ self.water1 = self.attachAsset('straightPipeV', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: -30,
+ tint: self.baseTint
+ });
+ self.water2 = self.attachAsset('straightPipeV', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: -1,
+ x: 30,
+ tint: self.baseTint
+ });
break;
case 'cornerPipe':
self.attachAsset('cornerPipe', {
anchorX: 0.5,
anchorY: 0.5,
x: -60,
- y: -60
+ y: -60,
+ tint: self.baseTintLight
});
break;
//case 'empty':
default:
@@ -140,8 +168,16 @@
self.rotation = Math.PI * 0.5;
log('Tile position:', self.x, self.y, 'Tile rotation:', self.rotation);
};
self.setType(self.type);
+ // Add update function to animate the alpha of self.water1 and self.water2
+ self.update = function () {
+ if (self.water1 && self.water2) {
+ var alphaValue = Math.abs(Math.sin(LK.ticks / 60));
+ self.water1.alpha = alphaValue;
+ self.water2.alpha = alphaValue;
+ }
+ };
return self;
});
/****
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