Update index.html
Browse files- index.html +45 -38
index.html
CHANGED
@@ -224,6 +224,7 @@
|
|
224 |
let warningLines = [];
|
225 |
let spitfires = [];
|
226 |
let lastSpitfireSpawn = 0;
|
|
|
227 |
|
228 |
// Load assets
|
229 |
const backgroundImg = new Image();
|
@@ -399,44 +400,50 @@
|
|
399 |
}, 3000);
|
400 |
}
|
401 |
}
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
}
|
441 |
|
442 |
function showShop() {
|
|
|
224 |
let warningLines = [];
|
225 |
let spitfires = [];
|
226 |
let lastSpitfireSpawn = 0;
|
227 |
+
let currentVoice = null;
|
228 |
|
229 |
// Load assets
|
230 |
const backgroundImg = new Image();
|
|
|
400 |
}, 3000);
|
401 |
}
|
402 |
}
|
403 |
+
function checkRoundClear() {
|
404 |
+
if(enemies.length === 0) {
|
405 |
+
console.log(`Checking round clear: Current round ${currentRound}, Boss stage: ${isBossStage}`);
|
406 |
+
|
407 |
+
// νλμ λλ€ν μμ±λ§ μ¬μ
|
408 |
+
if (!isBossStage) {
|
409 |
+
// μ΄μ μμ±μ΄ μλ€λ©΄ μ μ§
|
410 |
+
if (currentVoice) {
|
411 |
+
currentVoice.pause();
|
412 |
+
currentVoice.currentTime = 0;
|
413 |
+
}
|
414 |
+
|
415 |
+
const voiceFiles = ['voice1.ogg', 'voice2.ogg', 'voice3.ogg', 'voice4.ogg', 'voice5.ogg', 'voice6.ogg'];
|
416 |
+
const randomIndex = Math.floor(Math.random() * voiceFiles.length);
|
417 |
+
currentVoice = new Audio(voiceFiles[randomIndex]);
|
418 |
+
currentVoice.volume = 1.0;
|
419 |
+
currentVoice.play();
|
420 |
+
}
|
421 |
+
|
422 |
+
if (!isBossStage) {
|
423 |
+
if(currentRound < 10) {
|
424 |
+
console.log('Normal round clear - showing next round button and shop');
|
425 |
+
nextRoundBtn.style.display = 'block';
|
426 |
+
document.getElementById('bossButton').style.display = 'none';
|
427 |
+
showShop();
|
428 |
+
} else {
|
429 |
+
console.log('Final round clear - showing boss button');
|
430 |
+
nextRoundBtn.style.display = 'none';
|
431 |
+
document.getElementById('bossButton').style.display = 'block';
|
432 |
+
document.getElementById('shop').style.display = 'none';
|
433 |
+
}
|
434 |
+
} else {
|
435 |
+
console.log('Boss clear - showing victory message');
|
436 |
+
gameOver = true;
|
437 |
+
document.getElementById('winMessage').style.display = 'block';
|
438 |
+
document.getElementById('bossButton').style.display = 'none';
|
439 |
+
nextRoundBtn.style.display = 'none';
|
440 |
+
document.getElementById('shop').style.display = 'none';
|
441 |
+
restartBtn.style.display = 'block';
|
442 |
+
bgm.pause();
|
443 |
+
const victorySound = new Audio('victory.ogg');
|
444 |
+
victorySound.play();
|
445 |
+
}
|
446 |
+
}
|
447 |
}
|
448 |
|
449 |
function showShop() {
|