Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 110 bytes modified

beta.r3js.org
-=yb4f310 2018-03-24 14:25:13 +01:00
parent 1268482093
commit 8a4faac2e9
1 changed files with 14 additions and 7 deletions

View File

@ -157,7 +157,8 @@ this.state = {
exploding : false, exploding : false,
lives : 3, lives : 3,
getReady : false, getReady : false,
message : null message : null,
gameOver : false
}; };
GameLib.CustomCode.prototype.displayHUD = function() { GameLib.CustomCode.prototype.displayHUD = function() {
@ -228,12 +229,18 @@ GameLib.CustomCode.prototype.waitReload = function(delta) {
*/ */
console.warn('reverting to good state'); console.warn('reverting to good state');
this.displayHUD(); this.state.exploding = false;
if (this.lives < 0) {
this.state.gameOver = true;
this.state.message = "GAME OVER";
return;
}
this.displayHUD();
this.restore(); this.restore();
this.state.exploding = false;
this.state.getReady = true; this.state.getReady = true;
window.setTimeout( window.setTimeout(
@ -1547,7 +1554,7 @@ GameLib.Event.Subscribe(
lives : 3, lives : 3,
getReady : false, getReady : false,
message : null, message : null,
overrideOrientation : false gameOver : false
}; };
this.initializeGrid(); this.initializeGrid();