First adventure added. A bit of sound management improvement.

This commit is contained in:
Storm Dragon
2026-01-22 19:51:10 -05:00
parent ab7f3dc899
commit 35e192cb21
26 changed files with 851 additions and 54 deletions

View File

@@ -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);
}