diff --git a/assets/sounds/leak.ogg b/assets/sounds/leak.ogg new file mode 100644 index 0000000..3c916fd Binary files /dev/null and b/assets/sounds/leak.ogg differ diff --git a/src/audio.rs b/src/audio.rs index f544290..b7ef47b 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -78,6 +78,7 @@ const PATHS: &[(SfxType, Sfx, &str)] = &[ Sfx::IncomingChatMessage, "sounds/connect.ogg", ), + (SfxType::OneOff, Sfx::Leak, "sounds/leak.ogg"), (SfxType::OneOff, Sfx::Ping, "sounds/connect.ogg"), (SfxType::OneOff, Sfx::Phone, "sounds/phone.ogg"), (SfxType::OneOff, Sfx::PowerDown, "sounds/powerdown.ogg"), @@ -111,6 +112,7 @@ pub enum Sfx { Honk, IncomingChatMessage, Ion, + Leak, Ping, Phone, PowerDown, @@ -137,6 +139,7 @@ pub fn str2sfx(sfx_label: &str) -> Sfx { "zoom" => Sfx::Zoom, "cat" => Sfx::Cat, "chat" => Sfx::IncomingChatMessage, + "leak" => Sfx::Leak, "ping" => Sfx::Ping, "phone" => Sfx::Phone, "powerdown" => Sfx::PowerDown, diff --git a/src/game.rs b/src/game.rs index 8b32be8..1419a3d 100644 --- a/src/game.rs +++ b/src/game.rs @@ -339,6 +339,7 @@ fn handle_player_death( q_noscenes: Query, Without)>, mut scene_spawner: ResMut, mut active_asteroids: ResMut, + mut ew_sfx: EventWriter, mut ew_effect: EventWriter, mut ew_deathscreen: EventWriter, mut log: ResMut, @@ -363,6 +364,7 @@ fn handle_player_death( match death.0 { actor::DamageType::Depressurization => { + ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Leak)); settings.death_cause = "Depressurization".to_string(); ew_effect.send(visual::SpawnEffectEvent { class: visual::Effects::FadeIn(Color::BLACK),