Spaces:
Running
Running
cutechicken
commited on
Update index.html
Browse files- index.html +52 -30
index.html
CHANGED
@@ -605,11 +605,16 @@ function initRound() {
|
|
605 |
lastSupportSpawn = 0;
|
606 |
|
607 |
if (currentStage === 2) {
|
608 |
-
|
|
|
|
|
|
|
|
|
|
|
609 |
bgm.src = 'BGM3.ogg';
|
|
|
610 |
}
|
611 |
|
612 |
-
// μΉ΄μ΄νΈλ€μ΄ μμ
|
613 |
startCountdown();
|
614 |
|
615 |
// μΉ΄μ΄νΈλ€μ΄μ΄ λλλ©΄ JU87 μ€ν°
|
@@ -618,7 +623,7 @@ function initRound() {
|
|
618 |
supportUnits.push(new JU87());
|
619 |
lastJU87Spawn = Date.now();
|
620 |
}
|
621 |
-
}, 3000);
|
622 |
}
|
623 |
function startBossStage() {
|
624 |
isBossStage = true;
|
@@ -899,37 +904,54 @@ bossButton.addEventListener('click', startBossStage);
|
|
899 |
|
900 |
// λ€μ μ€ν
μ΄μ§ λ²νΌ μ΄λ²€νΈ 리μ€λ
|
901 |
document.getElementById('nextStage').addEventListener('click', () => {
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
907 |
});
|
908 |
|
909 |
restartBtn.addEventListener('click', () => {
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
|
|
931 |
});
|
932 |
-
|
933 |
Promise.all([
|
934 |
new Promise(resolve => backgroundImg.onload = resolve),
|
935 |
new Promise(resolve => playerImg.onload = resolve),
|
|
|
605 |
lastSupportSpawn = 0;
|
606 |
|
607 |
if (currentStage === 2) {
|
608 |
+
const newBackgroundImg = new Image();
|
609 |
+
newBackgroundImg.src = 'city2.png';
|
610 |
+
newBackgroundImg.onload = () => {
|
611 |
+
backgroundImg.src = 'city2.png';
|
612 |
+
};
|
613 |
+
bgm.pause();
|
614 |
bgm.src = 'BGM3.ogg';
|
615 |
+
bgm.play();
|
616 |
}
|
617 |
|
|
|
618 |
startCountdown();
|
619 |
|
620 |
// μΉ΄μ΄νΈλ€μ΄μ΄ λλλ©΄ JU87 μ€ν°
|
|
|
623 |
supportUnits.push(new JU87());
|
624 |
lastJU87Spawn = Date.now();
|
625 |
}
|
626 |
+
}, 3000);
|
627 |
}
|
628 |
function startBossStage() {
|
629 |
isBossStage = true;
|
|
|
904 |
|
905 |
// λ€μ μ€ν
μ΄μ§ λ²νΌ μ΄λ²€νΈ 리μ€λ
|
906 |
document.getElementById('nextStage').addEventListener('click', () => {
|
907 |
+
currentStage++;
|
908 |
+
currentRound = 1;
|
909 |
+
isBossStage = false;
|
910 |
+
document.getElementById('nextStage').style.display = 'none';
|
911 |
+
// μμ μμ΄ν
μ΄κΈ°ν μΆκ°
|
912 |
+
document.getElementById('tank1').style.display = 'block';
|
913 |
+
document.getElementById('tank2').style.display = 'block';
|
914 |
+
document.getElementById('apcr').style.display = 'block';
|
915 |
+
document.getElementById('bf109').style.display = 'block';
|
916 |
+
document.getElementById('ju87').style.display = 'block';
|
917 |
+
// κΈ°μ‘΄ ꡬ맀 μν μ΄κΈ°ν
|
918 |
+
hasAPCR = false;
|
919 |
+
hasBF109 = false;
|
920 |
+
hasJU87 = false;
|
921 |
+
supportUnits = [];
|
922 |
+
lastSupportSpawn = 0;
|
923 |
+
lastJU87Spawn = 0;
|
924 |
+
// νλ μ΄μ΄ μ΄κΈ°ν
|
925 |
+
player.health = player.maxHealth;
|
926 |
+
playerImg.src = 'player.png';
|
927 |
+
gold = 0;
|
928 |
+
initRound();
|
929 |
});
|
930 |
|
931 |
restartBtn.addEventListener('click', () => {
|
932 |
+
currentStage = 1; // μΆκ°
|
933 |
+
currentRound = 1;
|
934 |
+
gameOver = false;
|
935 |
+
isBossStage = false;
|
936 |
+
gold = 0;
|
937 |
+
hasAPCR = false; // APCR μ΄κΈ°ν
|
938 |
+
hasBF109 = false; // BF109 μ΄κΈ°ν
|
939 |
+
hasJU87 = false;
|
940 |
+
supportUnits = []; // μ§μ μ λ λ°°μ΄ μ΄κΈ°ν
|
941 |
+
|
942 |
+
restartBtn.style.display = 'none';
|
943 |
+
document.getElementById('winMessage').style.display = 'none';
|
944 |
+
document.getElementById('tank1').style.display = 'block';
|
945 |
+
document.getElementById('tank2').style.display = 'block';
|
946 |
+
document.getElementById('apcr').style.display = 'block';
|
947 |
+
document.getElementById('bf109').style.display = 'block'; // BF109 μμ μμ΄ν
λ€μ νμ
|
948 |
+
document.getElementById('ju87').style.display = 'block'; // JU87 μμ μμ΄ν
λ€μ νμ
|
949 |
+
|
950 |
+
playerImg.src = 'player.png';
|
951 |
+
bgm.src = 'BGM2.ogg';
|
952 |
+
bgm.play();
|
953 |
+
initRound();
|
954 |
});
|
|
|
955 |
Promise.all([
|
956 |
new Promise(resolve => backgroundImg.onload = resolve),
|
957 |
new Promise(resolve => playerImg.onload = resolve),
|