fix to correctly add to lifetime (it is always full lifetime since starting)

This commit is contained in:
Philip Rosedale 2015-07-20 08:40:12 -07:00
parent 66d61dc587
commit 45a229494b

View file

@ -12,8 +12,8 @@
// The area over which the birds will fly
var lowerCorner = { x: 1, y: 1, z: 1 };
var upperCorner = { x: 10, y: 10, z: 10 };
var lowerCorner = { x: 0, y: 0, z: 0 };
var upperCorner = { x: 10, y: 10, z: 10 };
var STARTING_FRACTION = 0.25;
var NUM_BIRDS = 50;
@ -119,7 +119,7 @@ function updateBirds(deltaTime) {
numPlaying++;
// Change size, and update lifetime to keep bird alive
Entities.editEntity(birds[i].entityId, { dimensions: Vec3.multiply(1.5, properties.dimensions),
lifetime: STARTING_LIFETIME});
lifetime: properties.ageInSeconds + STARTING_LIFETIME});
} else if (birds[i].audioId) {
// If bird is playing a chirp