2017-11-07 00:33:40 +01:00
|
|
|
if (this.parentEntity === data.entity) {
|
|
|
|
console.log('my entity loaded :)');
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.enemies = [];
|
|
|
|
|
2017-11-07 02:40:00 +01:00
|
|
|
var particle = GameLib.EntityManager.Instance.findComponentById('tiqzsk65l0');
|
|
|
|
particle.instance.visible = false;
|
|
|
|
|
2017-11-07 00:33:40 +01:00
|
|
|
/**
|
|
|
|
* Min and max spawn time is in seconds
|
|
|
|
*/
|
|
|
|
GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1;
|
|
|
|
GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4;
|
|
|
|
|
2017-11-08 12:24:50 +01:00
|
|
|
/**
|
|
|
|
* Tell all our custom code components that we loaded
|
|
|
|
*/
|
|
|
|
this.beforeRender = GameLib.EntityManager.Instance.findComponentById('9l6o7974qx');
|
2017-11-07 00:33:40 +01:00
|
|
|
this.beforeRender.entityLoaded = this;
|
2017-11-08 12:24:50 +01:00
|
|
|
|
|
|
|
this.mouseUp = GameLib.EntityManager.Instance.findComponentById('7vjcf5lwek');
|
|
|
|
this.mouseUp.entityLoaded = this;
|
|
|
|
|
|
|
|
this.mouseDown = GameLib.EntityManager.Instance.findComponentById('yfdl3odo4j');
|
|
|
|
this.mouseDown.entityLoaded = this;
|
|
|
|
|
|
|
|
this.mouseMove = GameLib.EntityManager.Instance.findComponentById('fsilsam72g');
|
|
|
|
this.mouseMove.entityLoaded = this;
|
|
|
|
|
2017-11-08 13:43:24 +01:00
|
|
|
/**
|
|
|
|
* Plant all our trees
|
|
|
|
*/
|
|
|
|
var treeSmall = GameLib.EntityManager.Instance.findComponentById('ctofpaaxhc');
|
|
|
|
var treeMedium = GameLib.EntityManager.Instance.findComponentById('48l6qb40bl');
|
|
|
|
var treeLarge = GameLib.EntityManager.Instance.findComponentById('owjdksm134');
|
2017-11-08 12:24:50 +01:00
|
|
|
|
2017-11-08 13:43:24 +01:00
|
|
|
var scene = GameLib.EntityManager.Instance.findComponentById('lpdxa66480');
|
2017-11-08 12:24:50 +01:00
|
|
|
|
2017-11-08 13:43:24 +01:00
|
|
|
var i = 0;
|
|
|
|
var tempTree = null;
|
2017-11-08 12:24:50 +01:00
|
|
|
|
2017-11-08 15:01:02 +01:00
|
|
|
var largeTrees = [];
|
|
|
|
var mediumTrees = [];
|
2017-11-08 16:04:01 +01:00
|
|
|
var smallTrees = [];
|
2017-11-08 14:59:42 +01:00
|
|
|
|
2017-11-08 14:59:02 +01:00
|
|
|
for (i = 1; i <= 10; i += 1) {
|
2017-11-08 15:00:36 +01:00
|
|
|
tempTree = treeLarge.clone();
|
2017-11-08 14:59:02 +01:00
|
|
|
tempTree.position.x = Math.cos(i) * 50;
|
2017-11-08 15:00:36 +01:00
|
|
|
tempTree.position.z = -1 * Math.sin(i) * 60;
|
2017-11-08 15:57:21 +01:00
|
|
|
|
2017-11-08 15:59:38 +01:00
|
|
|
if (i === 4) {
|
2017-11-08 15:57:21 +01:00
|
|
|
tempTree.position.x = -55.42;
|
|
|
|
tempTree.position.z = 12.01;
|
|
|
|
}
|
|
|
|
|
2017-11-08 15:59:38 +01:00
|
|
|
if (i === 5) {
|
2017-11-08 15:57:21 +01:00
|
|
|
tempTree.position.x = 48.84;
|
|
|
|
tempTree.position.z = -13.59;
|
|
|
|
}
|
|
|
|
|
2017-11-08 15:59:38 +01:00
|
|
|
if (i === 8) {
|
2017-11-08 15:57:21 +01:00
|
|
|
tempTree.position.x = 12.63;
|
|
|
|
tempTree.position.z = -77.27;
|
|
|
|
}
|
|
|
|
|
2017-11-08 15:59:38 +01:00
|
|
|
if (i === 10) {
|
2017-11-08 15:57:21 +01:00
|
|
|
tempTree.position.z = -45.43;
|
|
|
|
}
|
|
|
|
|
2017-11-08 15:20:22 +01:00
|
|
|
tempTree.updateInstance();
|
2017-11-08 15:57:21 +01:00
|
|
|
largeTrees.push(tempTree);
|
2017-11-08 13:43:24 +01:00
|
|
|
}
|
2017-11-08 14:21:16 +01:00
|
|
|
|
2017-11-08 16:03:13 +01:00
|
|
|
for (i = 1; i <= 10; i += 1) {
|
|
|
|
tempTree = treeMedium.cloneInstance();
|
|
|
|
tempTree.position.x = Math.cos(i) * 70;
|
|
|
|
tempTree.position.z = -1 * Math.sin(i) * 70;
|
2017-11-08 16:04:01 +01:00
|
|
|
|
|
|
|
tempTree.updateInstance();
|
|
|
|
mediumTrees.push(tempTree);
|
2017-11-08 14:53:39 +01:00
|
|
|
}
|
|
|
|
|
2017-11-08 16:04:01 +01:00
|
|
|
|
|
|
|
|
2017-11-08 14:53:39 +01:00
|
|
|
for (i = -100; i <= 100; i += 20) {
|
|
|
|
// tempTree = treeMedium.cloneInstance();
|
|
|
|
// tempTree.position.x = i;
|
|
|
|
// tempTree.position.z = -80;
|
2017-11-08 14:50:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-08 14:21:35 +01:00
|
|
|
//@ sourceURL=entityLoaded.js
|