User prompt
fix that the speechbubble is shown
User prompt
if the player hits a revolvingplanet, increase the score
User prompt
set the revolvingplanet to visible false, if the player collides with it
Code edit (4 edits merged)
Please save this source code
User prompt
Only check collision with planets which are visible
User prompt
if the revolvingplanet.parentPlanet respawns make sure to make it visible again
Code edit (1 edits merged)
Please save this source code
User prompt
Migrate to the latest version of LK
User prompt
play the jump sound whenver the player jumps
User prompt
add a sound "collect" and play it when the player collides with the revolvingplanet
User prompt
play a sound gameover when the game is over
User prompt
play a sound impact when the player collides lands on a planet
User prompt
Please fix the bug: 'TypeError: Cannot read properties of null (reading 'x')' in or related to this line: 'var dx = player.x - currentPlanet.x;' Line Number: 154
Code edit (1 edits merged)
Please save this source code
User prompt
add a music "flower" and play it at game start
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: LK.playMusic is not a function' in or related to this line: 'LK.playMusic('flower');' Line Number: 162
===================================================================
--- original.js
+++ change.js
@@ -120,12 +120,14 @@
var revolvingPlanet = new RevolvingPlanet();
revolvingPlanet.parentPlanet = planet;
var scale = planet.planetGraphics.scale.x / 2; // Scale the revolving planet to half the size of the parent planet
revolvingPlanet.planetGraphics.scale.set(scale, scale);
+ revolvingPlanet.radius = revolvingPlanet.planetGraphics.width / 2 * scale;
game.addChild(revolvingPlanet);
planets.push(revolvingPlanet);
}
}
+ console.log(planets);
// Create player
planets[0].x = 1024; // Start the first planet in the middle of the screen horizontally
planets[0].y = 1366; // Start the first planet in the middle of the screen vertically
currentPlanet = planets[0];
@@ -151,14 +153,15 @@
scoreTxt.setText(LK.getScore());
// Set the revolving planet to invisible when the player collides with it
if (planet instanceof RevolvingPlanet) {
planet.visible = false;
+ } else {
+ player.onGround = true;
+ player.velocity.y = 0;
+ currentPlanet = planet;
+ player.speechBubble.visible = false;
}
}
- player.onGround = true;
- player.velocity.y = 0;
- currentPlanet = planet;
- player.speechBubble.visible = false;
}
});
}
LK.on('tick', function () {
planet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. transparent background
monkey astronaut. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. transparent background
space background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. transparent background
speech bubble saying "wee". game asset. 2d. 8bit. no background. transparent background.
banana. game asset. 2d. 8bit. no background. transparent background.