From 12785b484ace4bda282a30ca2d69e6d7855e844c Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sun, 19 Nov 2017 17:43:30 +0100 Subject: [PATCH] Update: CC - Entity Loaded - Moorcow (xtihcyhagp.js) 423 bytes modified --- xtihcyhagp.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xtihcyhagp.js b/xtihcyhagp.js index c0e6476..870165d 100644 --- a/xtihcyhagp.js +++ b/xtihcyhagp.js @@ -107,6 +107,22 @@ GameLib.Event.Subscribe( }.bind(this) ); +GameLib.Event.Subscribe( + GameLib.Event.GAME_RESTART, + function() { + console.log('restarting game'); + + this.beforeRender.entityLoaded = null; + this.mouseUp.entityLoaded = null; + this.mouseDown.entityLoaded = null; + this.mouseMove.entityLoaded = null; + + this.beforeRender.initialized = false; + GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + GameLib.Event.Emit(GameLib.Event.GAME_START); + }.bind(this) +); + GameLib.Event.Subscribe( GameLib.Event.GAME_OVER, function() {