cutechicken commited on
Commit
094755b
ยท
verified ยท
1 Parent(s): 2296e98

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +12 -7
game.js CHANGED
@@ -3212,16 +3212,21 @@ class Game {
3212
  }
3213
 
3214
  startGameTimer() {
3215
- this.gameTimer = setInterval(() => {
3216
- if (!this.isGameOver) {
3217
- this.gameTime--;
3218
-
3219
- if (this.gameTime <= 0) {
 
 
 
 
3220
  this.endGame(true);
3221
  }
3222
  }
3223
- }, 1000);
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) {