Spaces:
Running
Running
cutechicken
commited on
Update index.html
Browse files- index.html +35 -33
index.html
CHANGED
@@ -374,25 +374,21 @@
|
|
374 |
}
|
375 |
return true;
|
376 |
});
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
restartBtn.style.display = 'block';
|
393 |
-
bgm.pause();
|
394 |
-
}
|
395 |
-
}
|
396 |
}
|
397 |
}
|
398 |
|
@@ -477,20 +473,26 @@
|
|
477 |
|
478 |
bossButton.addEventListener('click', startBossStage);
|
479 |
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
Promise.all([
|
495 |
new Promise(resolve => backgroundImg.onload = resolve),
|
496 |
new Promise(resolve => playerImg.onload = resolve),
|
|
|
374 |
}
|
375 |
return true;
|
376 |
});
|
377 |
+
if(enemies.length === 0) {
|
378 |
+
if (!isBossStage) {
|
379 |
+
if(currentRound < 10) {
|
380 |
+
nextRoundBtn.style.display = 'block'; // ๋ค์ ๋ผ์ด๋ ๋ฒํผ ํ์
|
381 |
+
showShop();
|
382 |
+
} else {
|
383 |
+
document.getElementById('bossButton').style.display = 'block';
|
384 |
+
}
|
385 |
+
} else {
|
386 |
+
gameOver = true;
|
387 |
+
document.getElementById('winMessage').style.display = 'block';
|
388 |
+
restartBtn.style.display = 'block';
|
389 |
+
bgm.pause();
|
390 |
+
}
|
391 |
+
}
|
|
|
|
|
|
|
|
|
392 |
}
|
393 |
}
|
394 |
|
|
|
473 |
|
474 |
bossButton.addEventListener('click', startBossStage);
|
475 |
|
476 |
+
nextRoundBtn.addEventListener('click', () => {
|
477 |
+
currentRound++;
|
478 |
+
nextRoundBtn.style.display = 'none';
|
479 |
+
document.getElementById('shop').style.display = 'none'; // ์์ ์ฐฝ ๋ซ๊ธฐ
|
480 |
+
initRound();
|
481 |
+
});
|
482 |
+
|
483 |
+
restartBtn.addEventListener('click', () => {
|
484 |
+
currentRound = 1;
|
485 |
+
gameOver = false;
|
486 |
+
isBossStage = false;
|
487 |
+
gold = 0;
|
488 |
+
restartBtn.style.display = 'none';
|
489 |
+
document.getElementById('winMessage').style.display = 'none';
|
490 |
+
document.getElementById('tank1').style.display = 'block';
|
491 |
+
document.getElementById('tank2').style.display = 'block';
|
492 |
+
playerImg.src = 'player.png';
|
493 |
+
bgm.play();
|
494 |
+
initRound();
|
495 |
+
});
|
496 |
Promise.all([
|
497 |
new Promise(resolve => backgroundImg.onload = resolve),
|
498 |
new Promise(resolve => playerImg.onload = resolve),
|