First adventure added. A bit of sound management improvement.
This commit is contained in:
@@ -181,6 +181,13 @@ void update_bandit(Bandit@ bandit) {
|
||||
if (bandit.alert_timer.elapsed > bandit.next_alert_delay) {
|
||||
bandit.alert_timer.restart();
|
||||
bandit.next_alert_delay = random(BANDIT_ALERT_MIN_DELAY, BANDIT_ALERT_MAX_DELAY);
|
||||
|
||||
// Destroy old sound handle before playing new one to prevent overlapping
|
||||
if (bandit.sound_handle != -1) {
|
||||
p.destroy_sound(bandit.sound_handle);
|
||||
bandit.sound_handle = -1;
|
||||
}
|
||||
|
||||
bandit.sound_handle = play_creature_voice(bandit.alert_sound, x, bandit.position, BANDIT_SOUND_VOLUME_STEP);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user