if (this.parentEntity === data.entity) { console.log('my entity loaded :)'); } else { return; } this.enemies = []; /** * Min and max spawn time is in seconds */ GameLib.CustomCode.MIN_SPAWN_TIME = 1; GameLib.CustomCode.MAX_SPAWN_TIME = 4; GameLib.CustomCode.OBJECT_BUFFER_SIZE = 5; /** * Create references to all our 'in game' objects */ this.fog = GameLib.EntityManager.Instance.findComponentById('prn0bjxe3h') this.bull = GameLib.EntityManager.Instance.findComponentById('cpcuzjjx27'); this.star = GameLib.EntityManager.Instance.findComponentById('lc7boe8lul'); this.burger = GameLib.EntityManager.Instance.findComponentById('suwsyomgc8'); this.parcel = GameLib.EntityManager.Instance.findComponentById('vikv0e8s04'); this.santa = GameLib.EntityManager.Instance.findComponentById('r0gkv2m07t'); this.camera = GameLib.EntityManager.Instance.findComponentById('2f5l1jt4yw'); this.scene = GameLib.EntityManager.Instance.findComponentById('z3ktrimsp8'); this.cursor = GameLib.EntityManager.Instance.findComponentById('zfu27tmjn4'); this.dom = GameLib.EntityManager.Instance.findComponentById('bl5vh0d2mt'); this.renderer = GameLib.EntityManager.Instance.findComponentById('wid7sf7y35'); this.thrower = GameLib.EntityManager.Instance.findComponentById('xtukuakue3'); //this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); this.treeSmall = GameLib.EntityManager.Instance.findComponentById('66lfvqjnsh'); this.treeMedium = GameLib.EntityManager.Instance.findComponentById('jkfx0aimom'); this.treeLarge = GameLib.EntityManager.Instance.findComponentById('53cg0zj637'); this.stone1 = GameLib.EntityManager.Instance.findComponentById('ouacwomksb'); this.stone2 = GameLib.EntityManager.Instance.findComponentById('zaen0snqwc'); this.kanister = GameLib.EntityManager.Instance.findComponentById('01hun2dd7x'); this.leftLight = GameLib.EntityManager.Instance.findComponentById('lbzb38hku5'); this.rightLight = GameLib.EntityManager.Instance.findComponentById('lbzb38hku5'); this.throwerLight = GameLib.EntityManager.Instance.findComponentById('z1jjutmra1'); this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('0j1szvj8gp'); this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('u8la6bqi9x'); this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('nnmuq10dbl'); this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('ofo2ota5bo'); this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('ulks1tuug6'); this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('t15omdm43f'); this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('gwi8qiymy5'); this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('g91m1tk6so'); this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('jdn84unl9b'); GameLib.Event.Emit( GameLib.Event.GET_RUNTIME, null, function(runtime) { this.graphics = runtime.graphics }.bind(this) ); this.mouse = new GameLib.Mouse(); this.raycaster = new GameLib.D3.Raycaster(this.graphics); this.beforeRender = GameLib.EntityManager.Instance.findComponentById('qemp4een6t'); this.mouseUp = GameLib.EntityManager.Instance.findComponentById('f0m7ptlxf3'); this.mouseDown = GameLib.EntityManager.Instance.findComponentById('jtmr6gmp5p'); this.mouseMove = GameLib.EntityManager.Instance.findComponentById('lxigrx11oc'); this.touchMove = GameLib.EntityManager.Instance.findComponentById('evwkow5289'); /** * Tell all our custom code components that we loaded */ GameLib.Event.Subscribe( GameLib.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; this.beforeRender.entityLoaded = this; this.mouseUp.entityLoaded = this; this.mouseDown.entityLoaded = this; this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; this.camera.lookAt.z = 0; this.camera.updateInstance('lookAt'); this.mouse.x = 0; this.mouse.y = 0; }.bind(this) ); /** * Plant all our trees - Below code gets generated automatically */ GameLib.Event.Emit(GameLib.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js