User prompt
Play a sound when you pick up a point.
User prompt
Add a sound when I jump.
Code edit (1 edits merged)
Please save this source code
User prompt
Decrease the velocity threshold on playing the land sound on platforms to 4.
User prompt
The land sound keeps being played when intersecting with a platform code where we only play the land sound if your velocity is above a reasonable threshold.
User prompt
Please pay attention to the sound effect when landing on a platform or the ground.
User prompt
Please delete the for loop that calls points.update() from the game.update() method.
User prompt
Please update the game.update method such that points.update is not called in the points loop.
User prompt
when picking up a point. I should get a point.
User prompt
So at around 50 percent chance spawn. And the platform.
User prompt
Remove all of the spawn point code, just delete the entire function.
User prompt
Make sure coins only spawn on top of a platform. Actually, make sure that coins or points or something that spawn in the center of a platform randomly.
User prompt
half the speed of the obstacles and only the obstacles.
User prompt
Double the speed of the platforms and points.
User prompt
In the GameUpdate method, delete the free lines that updates the platform.
User prompt
So in the update code, the moving of the points, so updating self.x should be the same code as it is in platforms.
User prompt
So, for the speed of the points and the platform, use a globally defined shared variable.
User prompt
Make the point elements move as fast as the platforms.
User prompt
Show my score at the top center of the screen.
User prompt
Add points elements to the game that can be picked up by the player. The points elements should be green. When you pick up a point, your score should increase by one.
User prompt
Also, spawn particles when you land on ground or a platform.
===================================================================
--- original.js
+++ change.js
@@ -243,8 +243,9 @@
for (var j = points.length - 1; j >= 0; j--) {
if (player.intersects(points[j])) {
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
+ LK.getSound('pointPickup').play(); // Play point pickup sound effect
points[j].destroy();
points.splice(j, 1);
}
}