Code edit (6 edits merged)
Please save this source code
User prompt
add the introPoster just above the statButton and remove it when removing startButton
Code edit (4 edits merged)
Please save this source code
User prompt
in stopBonus , restore speedFactor to PLAYER_SPEED_FACTOR_BASE
Code edit (7 edits merged)
Please save this source code
User prompt
in `if (nextNode && nextNode.background && nextNode.background.children.length > 0) {...}` search if a child of nextNode.background.children has property taken === false if so change add a new property autoTake = true to this child
Code edit (1 edits merged)
Please save this source code
User prompt
in Detritus.update, if detritusIndex == 0 log the parent.rotation
User prompt
while bonus is active, make check detrirus whose parent roadSegment reaching the node 0 to be automatically taken without need of intersect
Code edit (1 edits merged)
Please save this source code
User prompt
even with value 200 `Math.abs(self.parent.x + self.x - player.x) < 200 && Math.abs(self.parent.y + self.y - player.y) < 200 ` doesn't work. find another way to detect proximity
Code edit (1 edits merged)
Please save this source code
User prompt
`isBonusActive && Math.abs(self.x - player.x) < 150 && Math.abs(self.y - player.y) < 150 ||` I think self.x is relative it should take into acount parents position
Code edit (4 edits merged)
Please save this source code
User prompt
`isBonusActive && self.x === player.x && self.y === player.y ` is too restrictive, the detristus have just to pass near the player to be taken
User prompt
consition in `if (!self.taken && (isBonusActive || player.body.torso.intersects(self)))` is not enough because when isBonusActive still the detritus must reach player position (angle/ node) on the road
User prompt
while bonus is active, make detritus reaching the player position automatically taken without need of intersect
Code edit (3 edits merged)
Please save this source code
User prompt
in startBonusAnimation, call stopBouns() after BONUS_DURATION_SEC seconds
Code edit (9 edits merged)
Please save this source code
User prompt
in startBonusAnimation, when setting isBonusActive active stop bgMusic and play bonusMusic
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in Player.update(), add other flashy colors to animate player tint when bonus is active and make them change fast
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -867,9 +867,9 @@
self.taken = false;
self.update = function () {
if (self.taken) {
// TODO : Do domthing when Fragile Nature is hit
- } else if (!self.taken && (isBonusActive && Math.abs(self.x - player.x) < 50 && Math.abs(self.y - player.y) < 50 || player.body.torso.intersects(self))) {
+ } else if (!self.taken && (isBonusActive && Math.abs(self.parent.x + self.x - player.x) < 50 && Math.abs(self.parent.y + self.y - player.y) < 50 || player.body.torso.intersects(self))) {
self.taken = true;
}
};
return self;
@@ -915,9 +915,9 @@
self.x = targetX;
self.y = targetY;
self.destroy();
}
- } else if (!self.taken && (isBonusActive && Math.abs(self.x - player.x) < 50 && Math.abs(self.y - player.y) < 50 || player.body.torso.intersects(self))) {
+ } else if (!self.taken && (isBonusActive && Math.abs(self.parent.x + self.x - player.x) < 50 && Math.abs(self.parent.y + self.y - player.y) < 50 || player.body.torso.intersects(self))) {
self.taken = true;
// Flash Detritus in green for 500ms
LK.effects.flashObject(self, 0x00ff00, 500);
kgCollected += 0.01; // Add 0.01 to kgCollected
@@ -982,9 +982,9 @@
self.x = targetX;
self.y = targetY;
self.destroy();
}
- } else if (!self.taken && (isBonusActive && Math.abs(self.x - player.x) < 150 && Math.abs(self.y - player.y) < 150 || player.body.torso.intersects(self))) {
+ } else if (!self.taken && (isBonusActive && Math.abs(self.parent.x + self.x - player.x) < 150 && Math.abs(self.parent.y + self.y - player.y) < 150 || player.body.torso.intersects(self))) {
self.taken = true;
// Flash DetritusFlying in green for 500ms
LK.effects.flashObject(self, 0x00ff00, 500);
kgCollected += 0.02; // Add 0.01 to kgCollected
white
circle sliced into many pieces, flat image. 2d, white background, shadowless.
pixel art of a tall, tree. game asset, 2d, white background, shadowless.
pixel art cloud. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
dark space.
flying lava bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a bonus crystal ball with the recycle symbol. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
top view A green round start button empty in the center like a ring.