From 8a4faac2e974361464ee031acdd7a7c79238daa0 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sat, 24 Mar 2018 14:25:13 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 110 bytes modified --- 21g30t1e75.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) 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();