User prompt
add the paralax movement to the clouds too
Code edit (1 edits merged)
Please save this source code
User prompt
make clouds move slowly to the left the re-appear from the right
Code edit (3 edits merged)
Please save this source code
User prompt
add clouds at init time
User prompt
add a class clouds to the game
Code edit (4 edits merged)
Please save this source code
User prompt
extract the code of update when isReturningToBase to a separate method
Code edit (1 edits merged)
Please save this source code
User prompt
midground1 and foreground2 should only move when platforms move
User prompt
use NINJA_MOVEMENT_SPEED in handleBackgroundMovement
Code edit (2 edits merged)
Please save this source code
User prompt
when ninja runs, apply the same ratios to foreground and midground movement as when returning to base
Code edit (2 edits merged)
Please save this source code
User prompt
Loop: true doesnβt work. Use lk.setinterval with value 500
User prompt
Repeat the run sound while running, stop it when stops running
User prompt
Play stick grow sound when stick grows and stop it when stops
User prompt
Foreground and midground should also move when returning to base
User prompt
Foreground should move faster than midground
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
when isReturningToBase ,platformNext.x should not go below 2048-platformNext.width
User prompt
prevent stick to grow mare than 2048-stick.x-100
Code edit (1 edits merged)
Please save this source code
User prompt
revert platformMinWidth calculation : wider on first levelrs, thiner on high levels
===================================================================
--- original.js
+++ change.js
@@ -328,13 +328,13 @@
}
}
function handleBackgroundMovement() {
// Move midground images to the left
- midground1.x -= 7;
- midground2.x -= 7;
+ midground1.x -= 5;
+ midground2.x -= 5;
// Move foreground images to the left
- foreground1.x -= 10;
- foreground2.x -= 10;
+ foreground1.x -= 15;
+ foreground2.x -= 15;
// Reset midground position to create an infinite scrolling effect
if (midground1.x + 2048 / 2 < 0) {
midground1.x = midground2.x + 2048;
}
@@ -421,10 +421,10 @@
// Move objects towards the base position
platformCurrent.x += moveSpeed * Math.sign(distanceToMove);
platformTarget.x += moveSpeed * Math.sign(distanceToMove);
platformNext.x += moveSpeed * Math.sign(distanceToMove) * (platformNext.speedRatio || 1);
- if (platformNext.x - platformNext.width < 2048 + 512) {
- platformNext.x = 2048 + platformNext.width + 512;
+ if (platformNext.x - platformNext.width < 2048) {
+ platformNext.x = 2048 + platformNext.width;
}
ninja.x += moveSpeed * Math.sign(distanceToMove);
stick.x += moveSpeed * Math.sign(distanceToMove);
}