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

beta.r3js.org
-=yb4f310 2017-11-19 20:07:31 +01:00
parent a33e04d226
commit 5820e305d6
1 changed files with 5 additions and 9 deletions

View File

@ -63,6 +63,7 @@ this.beforeRender = GameLib.EntityManager.Instance.findComponentById('autqzs1rvq
this.mouseUp = GameLib.EntityManager.Instance.findComponentById('monq9ryw7a'); this.mouseUp = GameLib.EntityManager.Instance.findComponentById('monq9ryw7a');
this.mouseDown = GameLib.EntityManager.Instance.findComponentById('d5o2axpc0m'); this.mouseDown = GameLib.EntityManager.Instance.findComponentById('d5o2axpc0m');
this.mouseMove = GameLib.EntityManager.Instance.findComponentById('6st4io7ceu'); this.mouseMove = GameLib.EntityManager.Instance.findComponentById('6st4io7ceu');
this.touchMove = GameLib.EntityManager.Instance.findComponentById('c55930et90');
GameLib.Event.Subscribe( GameLib.Event.Subscribe(
GameLib.Event.WINDOW_RESIZE, GameLib.Event.WINDOW_RESIZE,
@ -88,6 +89,7 @@ GameLib.Event.Subscribe(
this.mouseUp.entityLoaded = this; this.mouseUp.entityLoaded = this;
this.mouseDown.entityLoaded = this; this.mouseDown.entityLoaded = this;
this.mouseMove.entityLoaded = this; this.mouseMove.entityLoaded = this;
this.touchMove.entityLoaded = this;
GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight});
@ -111,16 +113,9 @@ GameLib.Event.Subscribe(
GameLib.Event.Subscribe( GameLib.Event.Subscribe(
GameLib.Event.GAME_RESTART, GameLib.Event.GAME_RESTART,
function() { function() {
console.log('restarting game'); console.log('restarting game');
GameLib.Event.Emit(GameLib.Event.GAME_OVER);
this.beforeRender.entityLoaded = null;
this.mouseUp.entityLoaded = null;
this.mouseDown.entityLoaded = null;
this.mouseMove.entityLoaded = null;
delete this.beforeRender.initialized; delete this.beforeRender.initialized;
GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO);
GameLib.Event.Emit(GameLib.Event.GAME_START); GameLib.Event.Emit(GameLib.Event.GAME_START);
}.bind(this) }.bind(this)
); );
@ -133,6 +128,7 @@ GameLib.Event.Subscribe(
this.mouseUp.entityLoaded = null; this.mouseUp.entityLoaded = null;
this.mouseDown.entityLoaded = null; this.mouseDown.entityLoaded = null;
this.mouseMove.entityLoaded = null; this.mouseMove.entityLoaded = null;
this.touchMove.entityLoaded = null;
GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO);
}.bind(this) }.bind(this)