Bomb fix
This commit is contained in:
parent
acb76c195b
commit
82ffa5cbed
@ -178,7 +178,8 @@ function keyDownPressed(e) {
|
|||||||
if (e.keyCode === 80) togglePause();
|
if (e.keyCode === 80) togglePause();
|
||||||
|
|
||||||
if (e.keyCode === 16) {
|
if (e.keyCode === 16) {
|
||||||
if (abilityCharges > 0 && !game.gameOver && !gamePaused) {
|
// --- FIX DI SINI: Tambahkan pengecekan !player1.dead ---
|
||||||
|
if (abilityCharges > 0 && !game.gameOver && !gamePaused && !player1.dead) {
|
||||||
useAbility();
|
useAbility();
|
||||||
abilityCharges--;
|
abilityCharges--;
|
||||||
}
|
}
|
||||||
@ -831,8 +832,6 @@ function addShips() {
|
|||||||
spawnEnemyFromWave(currentWave);
|
spawnEnemyFromWave(currentWave);
|
||||||
currentWave.spawned++;
|
currentWave.spawned++;
|
||||||
// --- RANDOM SPACING ---
|
// --- RANDOM SPACING ---
|
||||||
// Membuat jarak muncul antar musuh bervariasi
|
|
||||||
// Kadang cepat, kadang ada jeda.
|
|
||||||
let randomSpacing =
|
let randomSpacing =
|
||||||
currentWave.spacing + Math.floor(Math.random() * 30);
|
currentWave.spacing + Math.floor(Math.random() * 30);
|
||||||
currentWave.spawnTimer = randomSpacing;
|
currentWave.spawnTimer = randomSpacing;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user