Spaces:
Running
Running
Update game.js
Browse files
game.js
CHANGED
|
@@ -3212,16 +3212,21 @@ class Game {
|
|
| 3212 |
}
|
| 3213 |
|
| 3214 |
startGameTimer() {
|
| 3215 |
-
|
| 3216 |
-
|
| 3217 |
-
|
| 3218 |
-
|
| 3219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3220 |
this.endGame(true);
|
| 3221 |
}
|
| 3222 |
}
|
| 3223 |
-
}
|
| 3224 |
-
}
|
|
|
|
| 3225 |
|
| 3226 |
// ์ ์ด ํ๋ ์ด์ด๋ฅผ ๋ฝ์จ ์์ํ ๋
|
| 3227 |
onEnemyLockStart(enemy) {
|
|
|
|
| 3212 |
}
|
| 3213 |
|
| 3214 |
startGameTimer() {
|
| 3215 |
+
this.gameTimer = setInterval(() => {
|
| 3216 |
+
if (!this.isGameOver) {
|
| 3217 |
+
this.gameTime--;
|
| 3218 |
+
|
| 3219 |
+
if (this.gameTime <= 0) {
|
| 3220 |
+
// ์๊ฐ์ด ๋๋ฌ์ ๋ ์ ์ด ๋จ์์์ผ๋ฉด ํจ๋ฐฐ, ๋ชจ๋ ์ ๊ฑฐํ์ผ๋ฉด ์น๋ฆฌ
|
| 3221 |
+
if (this.enemies.length > 0) {
|
| 3222 |
+
this.endGame(false, "TIME OVER - MISSION FAILED");
|
| 3223 |
+
} else {
|
| 3224 |
this.endGame(true);
|
| 3225 |
}
|
| 3226 |
}
|
| 3227 |
+
}
|
| 3228 |
+
}, 1000);
|
| 3229 |
+
}
|
| 3230 |
|
| 3231 |
// ์ ์ด ํ๋ ์ด์ด๋ฅผ ๋ฝ์จ ์์ํ ๋
|
| 3232 |
onEnemyLockStart(enemy) {
|