First adventure added. A bit of sound management improvement.
This commit is contained in:
@@ -134,6 +134,13 @@ void update_undead(Undead@ undead) {
|
||||
if (undead.groan_timer.elapsed > undead.next_groan_delay) {
|
||||
undead.groan_timer.restart();
|
||||
undead.next_groan_delay = random(ZOMBIE_GROAN_MIN_DELAY, ZOMBIE_GROAN_MAX_DELAY);
|
||||
|
||||
// Destroy old sound handle before playing new one to prevent overlapping
|
||||
if (undead.sound_handle != -1) {
|
||||
p.destroy_sound(undead.sound_handle);
|
||||
undead.sound_handle = -1;
|
||||
}
|
||||
|
||||
undead.sound_handle = play_creature_voice(undead.voice_sound, x, undead.position, ZOMBIE_SOUND_VOLUME_STEP);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user