From b74abd699d7dd0d0dc03e21ec685bc95606f21e7 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sun, 19 Nov 2017 11:43:05 +0100 Subject: [PATCH] Update: CC - Entity Loaded - Moorcow (xtihcyhagp.js) 108 bytes modified --- xtihcyhagp.js | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/xtihcyhagp.js b/xtihcyhagp.js index d2393d3..143f780 100644 --- a/xtihcyhagp.js +++ b/xtihcyhagp.js @@ -60,27 +60,34 @@ this.raycaster = new GameLib.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('autqzs1rvq'); -this.beforeRender.entityLoaded = this; +GameLib.Event.Subscribe( + GameLib.Event.GAME_START, + function() { + this.beforeRender = GameLib.EntityManager.Instance.findComponentById('autqzs1rvq'); + this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('monq9ryw7a'); -this.mouseUp.entityLoaded = this; + this.mouseUp = GameLib.EntityManager.Instance.findComponentById('monq9ryw7a'); + this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('d5o2axpc0m'); -this.mouseDown.entityLoaded = this; + this.mouseDown = GameLib.EntityManager.Instance.findComponentById('d5o2axpc0m'); + this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('6st4io7ceu'); -this.mouseMove.entityLoaded = this; + this.mouseMove = GameLib.EntityManager.Instance.findComponentById('6st4io7ceu'); + this.mouseMove.entityLoaded = this; + + GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + + GameLib.Event.Emit( + GameLib.Event.PLAY_AUDIO, + { + name : 'Audio - Xmas' + } + ); + } +); //GameLib.Event.Emit(GameLib.Event.MOUSE_UP); -GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, - { - name : 'Audio - Xmas' - } -); /** * Plant all our trees - Below code gets generated automatically