83 lines
2.6 KiB
JavaScript
83 lines
2.6 KiB
JavaScript
if (this.parentEntity === data.entity) {
|
|
console.log('my entity loaded :)');
|
|
} else {
|
|
return;
|
|
}
|
|
|
|
this.enemies = [];
|
|
|
|
/**
|
|
* Min and max spawn time is in seconds
|
|
*/
|
|
GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1;
|
|
GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4;
|
|
|
|
/**
|
|
* Tell all our custom code components that we loaded
|
|
*/
|
|
this.beforeRender = GameLib.EntityManager.Instance.findComponentById('4jubz9thqn');
|
|
this.beforeRender.entityLoaded = this;
|
|
|
|
this.mouseUp = GameLib.EntityManager.Instance.findComponentById('c7jkwjdjbk');
|
|
this.mouseUp.entityLoaded = this;
|
|
|
|
this.mouseDown = GameLib.EntityManager.Instance.findComponentById('j1gg46ln21');
|
|
this.mouseDown.entityLoaded = this;
|
|
|
|
this.mouseMove = GameLib.EntityManager.Instance.findComponentById('4rv4pr9m9q');
|
|
this.mouseMove.entityLoaded = this;
|
|
|
|
/**
|
|
* Create references to all our 'in game' objects
|
|
*/
|
|
this.bull = GameLib.EntityManager.Instance.findComponentById('g53xep7woq');
|
|
this.star = GameLib.EntityManager.Instance.findComponentById('yc8489392s');
|
|
this.burger = GameLib.EntityManager.Instance.findComponentById('d3lipkl5e6');
|
|
this.parcel = GameLib.EntityManager.Instance.findComponentById('uchnodlss4');
|
|
|
|
this.camera = GameLib.EntityManager.Instance.findComponentById('0ph5bo9dyi');
|
|
this.scene = GameLib.EntityManager.Instance.findComponentById('tcoetu9g5k');
|
|
|
|
this.cursor = GameLib.EntityManager.Instance.findComponentById('ah7gtz3mou');
|
|
this.thrower = GameLib.EntityManager.Instance.findComponentById('69a7qg3rkb');
|
|
|
|
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;
|
|
|
|
/**
|
|
* Plant all our trees
|
|
*/
|
|
var treeSmall = GameLib.EntityManager.Instance.findComponentById('dpd0qnvrrp');
|
|
var treeMedium = GameLib.EntityManager.Instance.findComponentById('n9tklzic0s');
|
|
var treeLarge = GameLib.EntityManager.Instance.findComponentById('ib2wuwzild');
|
|
var stone1 = GameLib.EntityManager.Instance.findComponentById('ig7vhdkoad');
|
|
var stone2 = GameLib.EntityManager.Instance.findComponentById('bvkorlbttn');
|
|
var materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('85ek16brbf');
|
|
|
|
var mesh = null;
|
|
var material = null;
|
|
|
|
/**
|
|
* No Clones for Olcayto
|
|
*/
|
|
|
|
//@ sourceURL=entityLoaded.js
|