Spaces:
Running
Running
cutechicken
commited on
Update index.html
Browse files- index.html +15 -13
index.html
CHANGED
@@ -595,7 +595,7 @@ function buyTank(tankImg, cost, tankId) {
|
|
595 |
lastShot = now;
|
596 |
}
|
597 |
}
|
598 |
-
|
599 |
if(gameOver) return;
|
600 |
if(!isCountingDown) {
|
601 |
// νλ μ΄μ΄ μμ§μ
|
@@ -608,11 +608,10 @@ function buyTank(tankImg, cost, tankId) {
|
|
608 |
fireBullet();
|
609 |
}
|
610 |
|
611 |
-
//
|
612 |
if (hasBF109 && !isCountingDown) {
|
613 |
const now = Date.now();
|
614 |
if (now - lastSupportSpawn > 10000) { // 10μ΄λ§λ€
|
615 |
-
// μλ¨, μ€λ¨, νλ¨μ μ λ μμ±
|
616 |
supportUnits.push(
|
617 |
new SupportUnit(canvas.height * 0.2),
|
618 |
new SupportUnit(canvas.height * 0.5),
|
@@ -620,17 +619,20 @@ function buyTank(tankImg, cost, tankId) {
|
|
620 |
);
|
621 |
lastSupportSpawn = now;
|
622 |
}
|
623 |
-
// μ§μ μ λ μ
λ°μ΄νΈ λ° νλ©΄ λ° μ λ μ κ±°
|
624 |
-
supportUnits = supportUnits.filter(unit => unit.update());
|
625 |
}
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
|
|
|
|
|
|
|
|
|
|
634 |
enemies.forEach(enemy => enemy.update());
|
635 |
if(!isCountingDown) {
|
636 |
bullets = bullets.filter(bullet => {
|
|
|
595 |
lastShot = now;
|
596 |
}
|
597 |
}
|
598 |
+
function updateGame() {
|
599 |
if(gameOver) return;
|
600 |
if(!isCountingDown) {
|
601 |
// νλ μ΄μ΄ μμ§μ
|
|
|
608 |
fireBullet();
|
609 |
}
|
610 |
|
611 |
+
// BF109 κ΄λ ¨ μ½λ
|
612 |
if (hasBF109 && !isCountingDown) {
|
613 |
const now = Date.now();
|
614 |
if (now - lastSupportSpawn > 10000) { // 10μ΄λ§λ€
|
|
|
615 |
supportUnits.push(
|
616 |
new SupportUnit(canvas.height * 0.2),
|
617 |
new SupportUnit(canvas.height * 0.5),
|
|
|
619 |
);
|
620 |
lastSupportSpawn = now;
|
621 |
}
|
|
|
|
|
622 |
}
|
623 |
+
|
624 |
+
// JU87 κ΄λ ¨ μ½λ μΆκ°
|
625 |
+
if (hasJU87 && !isCountingDown) {
|
626 |
+
const now = Date.now();
|
627 |
+
if (now - lastJU87Spawn > 15000) { // 15μ΄λ§λ€
|
628 |
+
supportUnits.push(new JU87());
|
629 |
+
lastJU87Spawn = now;
|
630 |
+
}
|
631 |
+
}
|
632 |
+
|
633 |
+
// λͺ¨λ μ§μ μ λ μ
λ°μ΄νΈ (BF109μ JU87 λͺ¨λ μ²λ¦¬)
|
634 |
+
supportUnits = supportUnits.filter(unit => unit.update());
|
635 |
+
|
636 |
enemies.forEach(enemy => enemy.update());
|
637 |
if(!isCountingDown) {
|
638 |
bullets = bullets.filter(bullet => {
|