Update: CC - Before Render - Moorcow (autqzs1rvq.js) 223 bytes modified
parent
74535a38cf
commit
13245be328
|
@ -49,6 +49,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
this.level = 1;
|
||||
this.spawnInterval = 5;
|
||||
this.score = 0;
|
||||
this.lives = 10;
|
||||
|
||||
this.enemies = [];
|
||||
|
||||
|
@ -638,6 +639,15 @@ this.enemies = this.enemies.reduce(
|
|||
*/
|
||||
this.kill(enemy);
|
||||
|
||||
if (!enemy.burning && !enemy.exploding) {
|
||||
this.lives--;
|
||||
console.log('lives left: ' + this.lives);
|
||||
|
||||
if (this.lives < 0) {
|
||||
GameLib.Event.Emit(GameLib.Event.GAME_OVER);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue