Update: CC - Before Render - Moorcow (autqzs1rvq.js) 223 bytes modified

beta.r3js.org
-=yb4f310 2017-11-18 13:25:45 +01:00
parent 74535a38cf
commit 13245be328
1 changed files with 10 additions and 0 deletions

View File

@ -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 {