From 6bc3dadae183104a4953dabfcbff140c4959fbfa Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 14 Nov 2017 08:54:47 +0100 Subject: [PATCH] Update: CC - Entity Loaded - Moorcow (m4c2psc19l.js) 468 bytes modified --- m4c2psc19l.js | 100 +++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 59 deletions(-) diff --git a/m4c2psc19l.js b/m4c2psc19l.js index 029baf3..1985b77 100644 --- a/m4c2psc19l.js +++ b/m4c2psc19l.js @@ -12,6 +12,40 @@ this.enemies = []; GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +/** + * Create references to all our 'in game' objects + */ +this.bull = GameLib.EntityManager.Instance.findComponentById('mkanjiompv'); +this.star = GameLib.EntityManager.Instance.findComponentById('5iz2kywf68'); +this.burger = GameLib.EntityManager.Instance.findComponentById('g26i649z3j'); +this.parcel = GameLib.EntityManager.Instance.findComponentById('s22s8m06q2'); +this.santa = GameLib.EntityManager.Instance.findComponentById('byqhlnuto0'); +this.camera = GameLib.EntityManager.Instance.findComponentById('2ya9b5if8y'); +this.scene = GameLib.EntityManager.Instance.findComponentById('f5d6aj9iiv'); +this.cursor = GameLib.EntityManager.Instance.findComponentById('ykfzwmaw9j'); + +this.thrower = GameLib.EntityManager.Instance.findComponentById('x4rhvbj8cn'); +this.renderer = GameLib.EntityManager.Instance.findComponentById('15rh0z60fi'); +this.treeSmall = GameLib.EntityManager.Instance.findComponentById('rgw0zarct7'); +this.treeMedium = GameLib.EntityManager.Instance.findComponentById('pnsitmldna'); +this.treeLarge = GameLib.EntityManager.Instance.findComponentById('hl3ydrafqd'); +this.stone1 = GameLib.EntityManager.Instance.findComponentById('qg4l7z9kvt'); +this.stone2 = GameLib.EntityManager.Instance.findComponentById('5gxxardq0g'); + +this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('0k1sgxm2vq'); +this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('9mm3vw8wtb'); + +GameLib.Event.Emit( + GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + null, + function(graphics) { + this.graphics = graphics + }.bind(this) +); + +this.mouse = new GameLib.Mouse(this.graphics); +this.raycaster = new GameLib.D3.Raycaster(this.graphics); + /** * Tell all our custom code components that we loaded */ @@ -27,69 +61,17 @@ this.mouseDown.entityLoaded = this; this.mouseMove = GameLib.EntityManager.Instance.findComponentById('8a0m30eevi'); this.mouseMove.entityLoaded = this; -/** - * Create references to all our 'in game' objects - */ -this.bull = GameLib.EntityManager.Instance.findComponentById('mkanjiompv'); -this.star = GameLib.EntityManager.Instance.findComponentById('5iz2kywf68'); -this.burger = GameLib.EntityManager.Instance.findComponentById('g26i649z3j'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('s22s8m06q2'); -this.santa = GameLib.EntityManager.Instance.findComponentById('byqhlnuto0'); - -this.camera = GameLib.EntityManager.Instance.findComponentById('2ya9b5if8y'); -this.scene = GameLib.EntityManager.Instance.findComponentById('f5d6aj9iiv'); - -this.cursor = GameLib.EntityManager.Instance.findComponentById('ykfzwmaw9j'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('x4rhvbj8cn'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('15rh0z60fi'); - -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('0k1sgxm2vq'); - -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, - null, - function(graphics) { - this.graphics = graphics - }.bind(this) -); - -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); - -/** - * Link some objects for MouseMove component - */ -this.mouseMove.mouse = this.mouse; -this.mouseMove.raycaster = this.raycaster; -this.mouseMove.camera = this.camera; -this.mouseMove.scene = this.scene; -this.mouseMove.cursor = this.cursor; -this.mouseMove.thrower = this.thrower; -this.mouseMove.throwerParticleEngine = this.throwerParticleEngine; - -/** - * Link some objects for MouseDown component - */ -this.mouseDown.throwerParticleEngine = this.throwerParticleEngine; -this.mouseDown.beforeRender = this.beforeRender; -/** - * Link some objects for MouseUp component - */ -this.mouseUp.throwerParticleEngine = this.throwerParticleEngine; -this.mouseUp.beforeRender = this.beforeRender; -this.mouseUp.renderer = this.renderer; - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); /** - * Plant all our trees + * Plant all our trees - Below code gets generated automatically */ -var treeSmall = GameLib.EntityManager.Instance.findComponentById('rgw0zarct7'); -var treeMedium = GameLib.EntityManager.Instance.findComponentById('pnsitmldna'); -var treeLarge = GameLib.EntityManager.Instance.findComponentById('hl3ydrafqd'); -var stone1 = GameLib.EntityManager.Instance.findComponentById('qg4l7z9kvt'); -var stone2 = GameLib.EntityManager.Instance.findComponentById('5gxxardq0g'); -var materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('9mm3vw8wtb'); +var treeSmall = this.treeSmall; +var treeMedium = this.treeMedium; +var treeLarge = this.treeLarge; +var stone1 = this.stone1; +var stone2 = this.stone2; +var materialTreesAndRocks = this.materialTreesAndRocks; var mesh = null; var material = null;