diff --git a/21g30t1e75.js b/21g30t1e75.js index 5954ef0..5538e63 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -157,7 +157,8 @@ this.state = { exploding : false, lives : 3, getReady : false, - message : null + message : null, + gameOver : false }; GameLib.CustomCode.prototype.displayHUD = function() { @@ -228,12 +229,18 @@ GameLib.CustomCode.prototype.waitReload = function(delta) { */ console.warn('reverting to good state'); - this.displayHUD(); - - this.restore(); - this.state.exploding = false; + if (this.lives < 0) { + this.state.gameOver = true; + this.state.message = "GAME OVER"; + return; + } + + this.displayHUD(); + + this.restore(); + this.state.getReady = true; window.setTimeout( @@ -973,7 +980,7 @@ GameLib.CustomCode.prototype.explode = function(position) { this.particleEnginePickle.updateInstance('position'); this.particleEnginePickle.enabled = true; - + }.bind(this) /** @@ -1547,7 +1554,7 @@ GameLib.Event.Subscribe( lives : 3, getReady : false, message : null, - overrideOrientation : false + gameOver : false }; this.initializeGrid();