mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-04 02:40:43 +02:00
adjustments
This commit is contained in:
parent
f867ebf1d1
commit
b8e731fd22
1 changed files with 25 additions and 9 deletions
|
@ -8,7 +8,7 @@ var USE_CONSTANT_SPAWNER = true;
|
||||||
var RAT_SPAWNER_LOCATION = {
|
var RAT_SPAWNER_LOCATION = {
|
||||||
x: 1000.5,
|
x: 1000.5,
|
||||||
y: 98,
|
y: 98,
|
||||||
z: 1039.5
|
z: 1040
|
||||||
};
|
};
|
||||||
|
|
||||||
var RAT_NEST_LOCATION = {
|
var RAT_NEST_LOCATION = {
|
||||||
|
@ -156,6 +156,8 @@ var THIRD_AVOIDER_FINISH_POSITION = {
|
||||||
z: 974
|
z: 974
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cleanupLeftoverAvoidersBeforeStart();
|
||||||
|
|
||||||
var avoiders = [];
|
var avoiders = [];
|
||||||
addAvoiderBlock(FIRST_AVOIDER_START_POSITION);
|
addAvoiderBlock(FIRST_AVOIDER_START_POSITION);
|
||||||
addAvoiderBlock(SECOND_AVOIDER_START_POSITION);
|
addAvoiderBlock(SECOND_AVOIDER_START_POSITION);
|
||||||
|
@ -178,7 +180,7 @@ function addAvoiderBlock(position) {
|
||||||
position: position,
|
position: position,
|
||||||
collisionsWillMove: false,
|
collisionsWillMove: false,
|
||||||
ignoreForCollisions: true,
|
ignoreForCollisions: true,
|
||||||
visible: true
|
visible: false
|
||||||
};
|
};
|
||||||
|
|
||||||
var avoider = Entities.addEntity(avoiderProperties);
|
var avoider = Entities.addEntity(avoiderProperties);
|
||||||
|
@ -401,6 +403,20 @@ function getMetaRatByRat(rat) {
|
||||||
|
|
||||||
Entities.deletingEntity.connect(popRatFromStack);
|
Entities.deletingEntity.connect(popRatFromStack);
|
||||||
|
|
||||||
|
|
||||||
|
function cleanupLeftoverAvoidersBeforeStart() {
|
||||||
|
print('CLEANING UP LEFTOVER AVOIDERS')
|
||||||
|
var nearbyEntities = Entities.findEntities(RAT_SPAWNER_LOCATION, 100);
|
||||||
|
var entityIndex;
|
||||||
|
for (entityIndex = 0; entityIndex < nearbyEntities.length; entityIndex++) {
|
||||||
|
var entityID = nearbyEntities[entityIndex];
|
||||||
|
var entityProps = Entities.getEntityProperties(entityID);
|
||||||
|
if (entityProps.name === 'Hifi-Rat-Avoider') {
|
||||||
|
Entities.deleteEntity(entityID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
while (rats.length > 0) {
|
while (rats.length > 0) {
|
||||||
Entities.deleteEntity(rats.pop());
|
Entities.deleteEntity(rats.pop());
|
||||||
|
|
Loading…
Reference in a new issue