This commit is contained in:
Bluwww 2025-12-15 20:00:45 +07:00
parent acb76c195b
commit 82ffa5cbed

View File

@ -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;