User prompt
please add a backdrop
User prompt
make the score increase by 1 everytime the player sucsesfully jumps over the enemy
User prompt
make the score text pastel pink
User prompt
add a score system everytime the player jumps over a enemy the score increases by 1
User prompt
make the enemys at the beginning slowly spawn as the game progress es the enemys spawn more often
User prompt
make the jump a little higher
User prompt
make the jump a litle bit higher
Initial prompt
kawaii parkour
===================================================================
--- original.js
+++ change.js
@@ -11,10 +11,14 @@
self.velocityY = 0;
self.isJumping = false;
self.isFlipping = false;
self.flipRotation = 0;
- self.incrementScore = function () {
- score++;
+ self.incrementScore = function (obstacle) {
+ if (!obstacle.hasScored) {
+ score++;
+ obstacle.hasScored = true;
+ scoreTxt.setText(score.toString());
+ }
};
self.moveRight = function () {
self.x += self.speed;
};
@@ -92,13 +96,11 @@
// Check for collision with player and if the player has jumped over an obstacle
if (player.intersects(obstacles[i])) {
// End game if collision occurs
LK.showGameOver();
- } else if (player.y < obstacles[i].y && player.x > obstacles[i].x) {
+ } else if (player.y < obstacles[i].y && player.x > obstacles[i].x && !obstacles[i].hasScored) {
// Increment score if player jumps over the obstacle
- player.incrementScore();
- // Ensure score is only incremented once per obstacle
- obstacles[i].hasScored = true;
+ player.incrementScore(obstacles[i]);
}
// Remove off-screen obstacles
if (obstacles[i].x + obstacles[i].width < 0) {
obstacles[i].destroy();
kawaii style kitten. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Kawaii style monster. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
kawaii style grass feild backdrop. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.