Update: CC - Entity Loaded - Moorcow (xtihcyhagp.js) 328 bytes modified

beta.r3js.org
-=yb4f310 2017-11-19 11:50:29 +01:00
parent cd14d2dd16
commit 8e38018563
1 changed files with 25 additions and 8 deletions

View File

@ -57,22 +57,21 @@ GameLib.Event.Emit(
this.mouse = new GameLib.Mouse(this.graphics);
this.raycaster = new GameLib.D3.Raycaster(this.graphics);
this.beforeRender = GameLib.EntityManager.Instance.findComponentById('autqzs1rvq');
this.mouseUp = GameLib.EntityManager.Instance.findComponentById('monq9ryw7a');
this.mouseDown = GameLib.EntityManager.Instance.findComponentById('d5o2axpc0m');
this.mouseMove = GameLib.EntityManager.Instance.findComponentById('6st4io7ceu');
/**
* Tell all our custom code components that we loaded
*/
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.mouseDown = GameLib.EntityManager.Instance.findComponentById('d5o2axpc0m');
this.mouseDown.entityLoaded = this;
this.mouseMove = GameLib.EntityManager.Instance.findComponentById('6st4io7ceu');
this.mouseDown.entityLoaded = this;
this.mouseMove.entityLoaded = this;
GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight});
@ -86,6 +85,24 @@ GameLib.Event.Subscribe(
}.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;
GameLib.Event.Emit(
GameLib.Event.STOP_AUDIO,
{
name : 'Audio - Xmas'
}
);
}.bind(this)
);
//GameLib.Event.Emit(GameLib.Event.MOUSE_UP);