|
@@ -17,6 +17,7 @@ export class Hive {
|
|
|
this.entranceWaypoint = null;
|
|
|
this.billboard = null;
|
|
|
this.yWobble = 0;
|
|
|
+ this.swarm;
|
|
|
}
|
|
|
static loadModel() {
|
|
|
return new Promise((resolve, reject) => {
|
|
@@ -51,7 +52,6 @@ export class Hive {
|
|
|
this.position.x = (70 * i) - 70;
|
|
|
this.position.z = Math.abs((20 * i) - 20);
|
|
|
this.rotation.y = ((Math.PI / 4)) - ((Math.PI / 4) * i);
|
|
|
- Hive.collection.push(this);
|
|
|
this.entranceWaypoint = Waypoint.addNewHive(this.scene, this);
|
|
|
this.billboard.position.set(this.position.x, this.position.y + 100, this.position.z);
|
|
|
this.billboard.scale.set(this.billboardCanvas.width / 10, this.billboardCanvas.height / 10, 1);
|
|
@@ -112,6 +112,7 @@ export class Hive {
|
|
|
let newBee = new Bee();
|
|
|
newBee.model = Bee.baseModel.clone();
|
|
|
newBee.init();
|
|
|
+ newBee.setSwarm(this.swarm);
|
|
|
newBee.setHive(this);
|
|
|
newBee.setPosition(this.position.x, this.position.y, this.position.z);
|
|
|
newBee.setLastPosition(this.position.x, this.position.y, this.position.z);
|
|
@@ -131,6 +132,7 @@ export class Hive {
|
|
|
if (!nextHive) {
|
|
|
return;
|
|
|
}
|
|
|
+ newBee.setSwarm(this.swarm);
|
|
|
newBee.setHive(nextHive);
|
|
|
newBee.setPosition(this.position.x, this.position.y, this.position.z);
|
|
|
newBee.setLastPosition(nextHive.position.x, nextHive.position.y, nextHive.position.z);
|
|
@@ -149,4 +151,8 @@ export class Hive {
|
|
|
this.entranceWaypoint.removeLine(flower);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ setSwarm(id) {
|
|
|
+ this.swarm = id;
|
|
|
+ }
|
|
|
}
|