User prompt
on tick check if backround is playing if not, play
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: LK.getSound(...).isPlaying is not a function' in or related to this line: 'if (!LK.getSound('Background').isPlaying()) {' Line Number: 300
User prompt
Ok tick check of background sound is playing, if not, then play
User prompt
Om game start play background sound
User prompt
When player hits obstacle play gameover sound
User prompt
If condition is set for game over, play gameover sound for 1 second before game over occura
User prompt
Make sure gameover sound is played before the game is over
User prompt
When game over play gameover sound
User prompt
When bullet hits obstacle play hit sound
User prompt
Play scream when bullet hits any enemy
User prompt
When bullet is shot use plop sound
User prompt
Migrate to the latest version of LK
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: hero.distanceTo is not a function' in this line: 'if (hero.intersects(obstacles[i]) && hero.distanceTo(obstacles[i]) < intersectionThreshold) {' Line Number: 173
User prompt
add a thershold for intersects bewteen hero and obstacle
Code edit (1 edits merged)
Please save this source code
User prompt
Update var threshold to 100
===================================================================
--- original.js
+++ change.js
@@ -226,8 +226,10 @@
score++;
obstacles[i].scoreAwarded = true;
}
scoreTxt.setText(score);
+ // Play 'Scream' sound when bullet hits enemy
+ LK.getSound('Scream').play();
} else {
hero.bullets[j].destroy();
hero.bullets.splice(j, 1);
}