From e45783651c39a3129e518e66564f88fffc92e105 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 24 Nov 2017 13:32:23 +0100 Subject: [PATCH] Update: CC - Entity Loaded - Moorcow (nuqb3rb3y5.js) 588 bytes modified --- nuqb3rb3y5.js | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/nuqb3rb3y5.js b/nuqb3rb3y5.js index e7ac6a2..71fb242 100644 --- a/nuqb3rb3y5.js +++ b/nuqb3rb3y5.js @@ -82,9 +82,11 @@ GameLib.Event.Subscribe( * Tell all our custom code components that we loaded */ GameLib.Event.Subscribe( - GameLib.Event.GAME_START, + GameLib.Event.CUSTOM_GAME_START, function() { + delete this.beforeRender.initialized; + this.beforeRender.entityLoaded = this; this.mouseUp.entityLoaded = this; this.mouseDown.entityLoaded = this; @@ -110,33 +112,6 @@ GameLib.Event.Subscribe( }.bind(this) ); -GameLib.Event.Subscribe( - GameLib.Event.GAME_RESTART, - function() { - console.log('restarting game'); - GameLib.Event.Emit(GameLib.Event.GAME_OVER); - delete this.beforeRender.initialized; - GameLib.Event.Emit(GameLib.Event.GAME_START); - }.bind(this) -); - -GameLib.Event.Subscribe( - GameLib.Event.GAME_OVER, - function() { - - this.beforeRender.entityLoaded = null; - this.mouseUp.entityLoaded = null; - this.mouseDown.entityLoaded = null; - this.mouseMove.entityLoaded = null; - this.touchMove.entityLoaded = null; - - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); - }.bind(this) -); - -//GameLib.Event.Emit(GameLib.Event.MOUSE_UP); - - /** * Plant all our trees - Below code gets generated automatically */