mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:42:53 +02:00
add identifyEntity() to butterflies script
This commit is contained in:
parent
497fbade9b
commit
0f5930a43d
1 changed files with 3 additions and 0 deletions
|
@ -103,6 +103,9 @@ function updateButterflies(deltaTime) {
|
||||||
var CHANCE_OF_IMPULSE = 0.04;
|
var CHANCE_OF_IMPULSE = 0.04;
|
||||||
for (var i = 0; i < numButterflies; i++) {
|
for (var i = 0; i < numButterflies; i++) {
|
||||||
if (Math.random() < CHANCE_OF_IMPULSE) {
|
if (Math.random() < CHANCE_OF_IMPULSE) {
|
||||||
|
if (!butterflies[i].isKnownID) {
|
||||||
|
butterflies[i] = Entities.identifyEntity(butterflies[i]);
|
||||||
|
}
|
||||||
var properties = Entities.getEntityProperties(butterflies[i]);
|
var properties = Entities.getEntityProperties(butterflies[i]);
|
||||||
if (Vec3.length(Vec3.subtract(properties.position, flockPosition)) > range) {
|
if (Vec3.length(Vec3.subtract(properties.position, flockPosition)) > range) {
|
||||||
Entities.editEntity(butterflies[i], { position: flockPosition } );
|
Entities.editEntity(butterflies[i], { position: flockPosition } );
|
||||||
|
|
Loading…
Reference in a new issue