cutechicken commited on
Commit
3091499
Β·
verified Β·
1 Parent(s): f2b908e

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +75 -58
index.html CHANGED
@@ -528,64 +528,81 @@
528
  }
529
  }
530
  function checkRoundClear() {
531
- if(enemies.length === 0) {
532
- console.log(`Checking round clear: Current round ${currentRound}, Boss stage: ${isBossStage}`);
533
-
534
- // ν•˜λ‚˜μ˜ λžœλ€ν•œ μŒμ„±λ§Œ μž¬μƒ
535
- if (!isBossStage) {
536
- // 이전 μŒμ„±μ΄ μžˆλ‹€λ©΄ μ •μ§€
537
- if (currentVoice) {
538
- currentVoice.pause();
539
- currentVoice.currentTime = 0;
540
- }
541
-
542
- const voiceFiles = ['voice1.ogg', 'voice2.ogg', 'voice3.ogg', 'voice4.ogg', 'voice5.ogg', 'voice6.ogg'];
543
- const randomIndex = Math.floor(Math.random() * voiceFiles.length);
544
- currentVoice = new Audio(voiceFiles[randomIndex]);
545
- currentVoice.volume = 1.0;
546
- currentVoice.play();
547
- }
548
-
549
- if (currentStage === 3) {
550
- if (currentRound === 10) {
551
- // 10λΌμš΄λ“œ 보슀 클리어 ν›„ λ‹€μŒ λΌμš΄λ“œλ‘œ
552
- nextRoundBtn.style.display = 'block';
553
- showShop(); // 상점창도 ν•¨κ»˜ ν‘œμ‹œ
554
- } else if (currentRound === 20) {
555
- // 20λΌμš΄λ“œ 보슀 클리어 ν›„ κ²Œμž„ 승리
556
- document.getElementById('winMessage').style.display = 'block';
557
- restartBtn.style.display = 'block';
558
- gameOver = true;
559
- } else if (currentRound < 20) {
560
- // 일반 λΌμš΄λ“œ 클리어
561
- nextRoundBtn.style.display = 'block';
562
- showShop();
563
- }
564
- } else if (!isBossStage) {
565
- if(currentRound < 10) {
566
- console.log('Normal round clear - showing next round button and shop');
567
- nextRoundBtn.style.display = 'block';
568
- document.getElementById('bossButton').style.display = 'none';
569
- showShop();
570
- } else {
571
- console.log('Final round clear - showing boss button');
572
- nextRoundBtn.style.display = 'none';
573
- document.getElementById('bossButton').style.display = 'block';
574
- document.getElementById('shop').style.display = 'none';
575
- }
576
- } else {
577
- console.log('Boss clear - showing victory message');
578
- gameOver = true;
579
- document.getElementById('winMessage').style.display = 'block';
580
- document.getElementById('bossButton').style.display = 'none';
581
- nextRoundBtn.style.display = 'none';
582
- document.getElementById('shop').style.display = 'none';
583
- restartBtn.style.display = 'block';
584
- bgm.pause();
585
- const victorySound = new Audio('victory.ogg');
586
- victorySound.play();
587
- }
588
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  }
590
 
591
  function showShop() {
 
528
  }
529
  }
530
  function checkRoundClear() {
531
+ if(enemies.length === 0) {
532
+ console.log(`Checking round clear: Current round ${currentRound}, Boss stage: ${isBossStage}`);
533
+
534
+ // ν•˜λ‚˜μ˜ λžœλ€ν•œ μŒμ„±λ§Œ μž¬μƒ
535
+ if (!isBossStage) {
536
+ // 이전 μŒμ„±μ΄ μžˆλ‹€λ©΄ μ •μ§€
537
+ if (currentVoice) {
538
+ currentVoice.pause();
539
+ currentVoice.currentTime = 0;
540
+ }
541
+
542
+ const voiceFiles = ['voice1.ogg', 'voice2.ogg', 'voice3.ogg', 'voice4.ogg', 'voice5.ogg', 'voice6.ogg'];
543
+ const randomIndex = Math.floor(Math.random() * voiceFiles.length);
544
+ currentVoice = new Audio(voiceFiles[randomIndex]);
545
+ currentVoice.volume = 1.0;
546
+ currentVoice.play();
547
+ }
548
+
549
+ if (currentStage === 3) {
550
+ if (currentRound === 10) {
551
+ // 10λΌμš΄λ“œ 보슀 클리어 ν›„ λ‹€μŒ λΌμš΄λ“œλ‘œ
552
+ nextRoundBtn.style.display = 'block';
553
+ showShop(); // 상점창도 ν•¨κ»˜ ν‘œμ‹œ
554
+ } else if (currentRound === 20) {
555
+ // 20λΌμš΄λ“œ 보슀 클리어 ν›„ κ²Œμž„ 승리
556
+ document.getElementById('winMessage').style.display = 'block';
557
+ restartBtn.style.display = 'block';
558
+ gameOver = true;
559
+
560
+ // λͺ¨λ“  μ˜€λ””μ˜€ μ •μ§€
561
+ bgm.pause();
562
+ bgm.currentTime = 0;
563
+ cannonSound.pause();
564
+ machinegunSound.pause();
565
+ enemyFireSound.pause();
566
+ countSound.pause();
567
+ deathSound.pause();
568
+ escapeSound.pause();
569
+ hitSounds.forEach(sound => { sound.pause(); sound.currentTime = 0; });
570
+ reloadSounds.forEach(sound => { sound.pause(); sound.currentTime = 0; });
571
+
572
+ // 승리 μ‚¬μš΄λ“œ μž¬μƒ
573
+ const victorySound = new Audio('victory.ogg');
574
+ victorySound.volume = 1.0;
575
+ victorySound.play();
576
+ } else if (currentRound < 20) {
577
+ // 일반 λΌμš΄λ“œ 클리어
578
+ nextRoundBtn.style.display = 'block';
579
+ showShop();
580
+ }
581
+ } else if (!isBossStage) {
582
+ if(currentRound < 10) {
583
+ console.log('Normal round clear - showing next round button and shop');
584
+ nextRoundBtn.style.display = 'block';
585
+ document.getElementById('bossButton').style.display = 'none';
586
+ showShop();
587
+ } else {
588
+ console.log('Final round clear - showing boss button');
589
+ nextRoundBtn.style.display = 'none';
590
+ document.getElementById('bossButton').style.display = 'block';
591
+ document.getElementById('shop').style.display = 'none';
592
+ }
593
+ } else {
594
+ console.log('Boss clear - showing victory message');
595
+ gameOver = true;
596
+ document.getElementById('winMessage').style.display = 'block';
597
+ document.getElementById('bossButton').style.display = 'none';
598
+ nextRoundBtn.style.display = 'none';
599
+ document.getElementById('shop').style.display = 'none';
600
+ restartBtn.style.display = 'block';
601
+ bgm.pause();
602
+ const victorySound = new Audio('victory.ogg');
603
+ victorySound.play();
604
+ }
605
+ }
606
  }
607
 
608
  function showShop() {