User prompt
make them faster and worth 8 points
User prompt
make the red enemies faster
User prompt
make the red enemies more rare
User prompt
make the red enemies faster
User prompt
they're still red
User prompt
now the non homing enemies are red too
User prompt
the homing enemies are not red
User prompt
make the enemies sometimes be red and home in on the player
User prompt
add a score counter in the corner
User prompt
it doesn't display the score on the game over screen
User prompt
add a score system that adds 1 to the score each time you defeat an enemy and displays the score on the game over screen
User prompt
make it so the game resets when you hit the enemies
User prompt
make it so when you click it fires
Initial prompt
dodge the lasers
===================================================================
--- original.js
+++ change.js
@@ -49,8 +49,13 @@
* Game Code
****/
// Fire lasers when the game area is clicked
// Initialize player, enemy, and laser assets for the game.
+var scoreTxt = new Text2('0', {
+ size: 100,
+ fill: '#ffffff'
+});
+LK.gui.topLeft.addChild(scoreTxt);
var score = 0;
game.on('down', function () {
var laser = new Laser();
laser.x = player.x;
@@ -105,8 +110,9 @@
lasers.splice(k, 1);
enemies[l].destroy();
enemies.splice(l, 1);
score++;
+ scoreTxt.setText(score);
break; // Exit the inner loop after a collision
}
}
}
green cartoon laser. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
red cartoon laser. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pink cartoon laser. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
sci-fi cartoon spaceship. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.