mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
re-use audio injectors, don't check if isPlaying immediately after starting play out
This commit is contained in:
parent
5c29eb97ef
commit
db219905f3
1 changed files with 3 additions and 5 deletions
|
@ -108,14 +108,11 @@ function updateBirds(deltaTime) {
|
|||
// Change size
|
||||
Entities.editEntity(birds[i].entityId, { dimensions: Vec3.multiply(1.5, properties.dimensions)});
|
||||
|
||||
}
|
||||
|
||||
if (birds[i].audioId) {
|
||||
} else if (birds[i].audioId) {
|
||||
// If bird is playing a chirp
|
||||
if (!birds[i].audioId.isPlaying) {
|
||||
// clear ID if playing has stopped
|
||||
Entities.editEntity(birds[i].entityId, { dimensions: { x: BIRD_SIZE, y: BIRD_SIZE, z: BIRD_SIZE }});
|
||||
birds[i].audioId = false;
|
||||
numPlaying--;
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +248,8 @@ function loadBirds(howMany) {
|
|||
collisionsWillMove: true,
|
||||
color: colors[whichBird]
|
||||
}),
|
||||
audioId: false
|
||||
audioId: false,
|
||||
isPlaying: false
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue