mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 07:23:39 +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
|
// Change size
|
||||||
Entities.editEntity(birds[i].entityId, { dimensions: Vec3.multiply(1.5, properties.dimensions)});
|
Entities.editEntity(birds[i].entityId, { dimensions: Vec3.multiply(1.5, properties.dimensions)});
|
||||||
|
|
||||||
}
|
} else if (birds[i].audioId) {
|
||||||
|
|
||||||
if (birds[i].audioId) {
|
|
||||||
// If bird is playing a chirp
|
// If bird is playing a chirp
|
||||||
if (!birds[i].audioId.isPlaying) {
|
if (!birds[i].audioId.isPlaying) {
|
||||||
// clear ID if playing has stopped
|
// clear ID if playing has stopped
|
||||||
Entities.editEntity(birds[i].entityId, { dimensions: { x: BIRD_SIZE, y: BIRD_SIZE, z: BIRD_SIZE }});
|
Entities.editEntity(birds[i].entityId, { dimensions: { x: BIRD_SIZE, y: BIRD_SIZE, z: BIRD_SIZE }});
|
||||||
birds[i].audioId = false;
|
|
||||||
numPlaying--;
|
numPlaying--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +248,8 @@ function loadBirds(howMany) {
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
color: colors[whichBird]
|
color: colors[whichBird]
|
||||||
}),
|
}),
|
||||||
audioId: false
|
audioId: false,
|
||||||
|
isPlaying: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue