Code edit (2 edits merged)
Please save this source code
User prompt
the playerDuck instance is not showb
Code edit (3 edits merged)
Please save this source code
User prompt
create a "finishLine" graphic and place it at the right side
Code edit (8 edits merged)
Please save this source code
User prompt
the opponent ducks are moving at the same speed. Make it that they slow down / speed up randomly
User prompt
after start, play the duck sound in random intervals
User prompt
make a graphic waves
User prompt
spawn multiple waves at the bottom
User prompt
make the waves move up and down in a wave movement
===================================================================
--- original.js
+++ change.js
@@ -107,10 +107,12 @@
if (playerDuck.x > finishLine.x) {
LK.showYouWin();
return;
}
- // Make the wave move up and down
- wave.y += Math.sin(LK.ticks / 60) * 5;
+ // Make the waves move up and down in a wave movement
+ for (var i = 0; i < waves.length; i++) {
+ waves[i].y += Math.sin((LK.ticks + i * 10) / 60) * 5;
+ }
if (LK.ticks % Math.floor(Math.random() * 60 + 60) == 0) {
LK.getSound('quack').play();
}
for (var j = 0; j < ducks.length; j++) {