User prompt
Se cada bala cair para o lado de baixo, consegue um ponto.
User prompt
Faça com que, se a bala cair e os pontos contam, os pontos só contam se o quadrado spawnar.
User prompt
Após chegar a 100 pontos, o jogo avisa que as balas aceleram de velocidade e as balas realmente aceleram de velocidade.
User prompt
Adicione os ícones de coração no topo da tela direita.
User prompt
Está muito difícil ver eles. Coloque eles menos na borda da tela, aí fica mais fácil ver.
User prompt
Coloque menos.
User prompt
Coloque menos na borda da tela.
User prompt
Começa com que as balas estejam com o dobro de velocidade após 200 pontos.
User prompt
Se o player não ficar na borda, consegue, sem tocar na borda, ponto. Se tocar na borda, perde esses pontos.
===================================================================
--- original.js
+++ change.js
@@ -163,8 +163,22 @@
/****
* Game Code
****/
+// Function to update heart icons based on player lives
+function updateHearts() {
+ // Clear existing hearts
+ LK.gui.topRight.removeChildren();
+ // Add heart icons based on the number of lives
+ for (var i = 0; i < player.lives; i++) {
+ var heartIcon = LK.getAsset('Heart_icon', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ heartIcon.x = -50 * i; // Position hearts with some spacing
+ LK.gui.topRight.addChild(heartIcon);
+ }
+}
var menu = new Menu();
menu.x = 2048 / 2;
menu.y = 2732 / 2;
game.addChild(menu);
@@ -194,8 +208,9 @@
player = new Player();
player.x = 2048 / 2;
player.y = 2732 - 200;
game.addChild(player);
+ updateHearts(); // Display hearts when the game starts
}, 1000);
}, 1000);
}, 1000);
};
@@ -284,8 +299,9 @@
player.lives -= 1;
LK.getSound('Hit').play();
bullet.destroy(); // Remove the bullet upon collision
enemyBullets.splice(i, 1); // Remove bullet from array
+ updateHearts(); // Update hearts when player loses a life
if (player.lives <= 0) {
LK.showGameOver();
}
}
Cube. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Cube bullet hell icon. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Start_button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Heart_icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows