From f4aea80f3407bd74e1f746c3a29062e696a74cb1 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 28 Mar 2024 14:10:10 +0100 Subject: [PATCH] add rocket sound effect for bike --- README.md | 1 + assets/sounds/rocket.ogg | Bin 0 -> 14286 bytes src/actor.rs | 9 +++++++++ src/audio.rs | 13 +++++++++++++ src/camera.rs | 10 +++++++++- src/defs.txt | 1 + src/world.rs | 8 ++++++-- 7 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 assets/sounds/rocket.ogg diff --git a/README.md b/README.md index 1ffc19c..015b8e7 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ More information here: https://bevy-cheatbook.github.io/setup/cross/linux-window - https://pixabay.com/sound-effects/click-button-140881 - https://pixabay.com/sound-effects/data-transmission-sound-from-14664-72309 - https://pixabay.com/sound-effects/thrusters-loopwav-14699 +- https://pixabay.com/sound-effects/rocket-loop-99748 - Star chart based on the [HYG Stellar database](https://github.com/astronexus/HYG-Database) - Custom font Yupiter is based on: - Noto Sans Symbols 2, Copyright 2022 The Noto Project Authors (https://github.com/notofonts/symbols) diff --git a/assets/sounds/rocket.ogg b/assets/sounds/rocket.ogg new file mode 100644 index 0000000000000000000000000000000000000000..2e9a860d4215b3f476fa985ddd12ca4513be7468 GIT binary patch literal 14286 zcmc(`cUV)|_Aq=XLO{S!4Hz_`Ng!~OP$WT|&`Bsl=*^)7q^eX!1~0vYfDl5YOG!cz zkQNkBf6_bBMG(hEFV5(w)9#)31n1uG``$mk=l$>9&&fV}pS{*PXRW>VT5FeFynNXi z5Cr~Cm(KXC@{3Aee9j7-7KpzZ9S|DBe<1kOmwy8Qzfystd!xWbKIVTDACup*qw=Iv ziul+6E7b~pBO?j6+WE%^8)9^^hPqe`h7W!Q`~_VJyh;sc&I@S`HPZ*O&(iLl~%_dNz%4W03IyLib!id2rEYP}#N;4Zz znJsVy_y}ycyJIv-XR9Kn4(2`;wT%Ev8;HwOQDW*~DIdSZh|b4;Yn6&d@!?YBt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I&sE{}Cc1TpZOl6eYBn+HTA#*kJ4 z0G+C4tH)A6IgO=uy0k;HgU7-w2-enie|h)(qtZUSTibp&HMciv@$`uNJHxDXe3;8A zwJ(b?&)&YEJHpWAaUGN1i8mDG7X5B~i38y44p3;Fu< z6(HV;T%et{!Q+qrm!TLDa&%*lj~M}%672%{dpnLo$i)Xq5`)j z_-9r$H|)Wj`PM6nqJ8~jk3fKO-@eT~J^h5xlSl=b4EPyi<=&8aSX~j;u zt^jQD)Oi7f6IP9)9~c_Mn!?BG2E=2%Lj&8{o>CrNf$Fy=j@A!1K7(7#7|epssp^Mr zS6W;Ty~_O-NU%{SPp!(C*{E*K;;%j{yn&LJ$3{GC97Z%02iP~$B_KVKmqpw=BhuZ1 zc2x}C2FAbI=&GoUoVF~c<-hZaQ z^cp*ECs}yiN6Xo&?)M}wPwokZ|A8SW|TWK$MFPK zo(s@pT0QLPzwE^I?aKxZ%?^i@4a?Nb4%dnTZoT&mfDk|3^(7@hA9Foebq6l!S?Y!w zW_m}awxwYTvx}T?D&mkqBlxAEN{7|{2wwyv3u=aRW}PIHQ)Snrppj5FG=Ya0ruF!s zVQ7ww$<+MMpF06gwVR$Si#L~}2{wDEDBab@QnbfiWxHsLU)1CYaFPDK#+lZ$2_~^zdVTYjbm<*p`G-)C*cIu8`~n5wWu|Ln?@ej`_;GM`MQtkrx@MBH`P|HM6q!8Rv7xkRs)e*pJli1Y{%a=K=e Self { Self { #[derive(Component)] pub struct Vehicle; +#[derive(Copy, Clone, PartialEq)] +pub enum EngineType { + Monopropellant, + Rocket, + //Ion, +} + #[derive(Component)] pub struct Engine { pub thrust_forward: f32, pub thrust_back: f32, pub thrust_sideways: f32, pub reaction_wheels: f32, + pub engine_type: EngineType, } impl Default for Engine { fn default() -> Self { @@ -139,6 +147,7 @@ impl Default for Engine { thrust_back: 1.0, thrust_sideways: 1.0, reaction_wheels: 1.0, + engine_type: EngineType::Monopropellant, } } } diff --git a/src/audio.rs b/src/audio.rs index 7c5bb8a..48b3673 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -10,6 +10,7 @@ const ASSET_CONNECT: &str = "sounds/connect.ogg"; const ASSET_RADIO: &str = "external/LP - Girls Go Wild (Official Music Video) [M7XRN0oHGIM].mp3"; const ASSET_BGM: &str = "external/Ben Prunty - FTL - 12 Void (Explore).mp3"; const ASSET_THRUSTER: &str = "sounds/thruster.ogg"; +const ASSET_ROCKET: &str = "sounds/rocket.ogg"; const ASSET_WAKEUP: &str = "sounds/wakeup.ogg"; pub struct AudioPlugin; @@ -39,6 +40,7 @@ pub enum Sfx { #[derive(Component)] pub struct ComponentBGM; #[derive(Component)] pub struct ComponentRadio; #[derive(Component)] pub struct ComponentThrusterSound; +#[derive(Component)] pub struct ComponentRocketSound; #[derive(Component)] struct SoundBGM(Handle); #[derive(Component)] pub struct SoundRadio(Handle); #[derive(Resource)] pub struct SoundClick(Handle); @@ -93,6 +95,17 @@ pub fn setup( }, }, )); + commands.spawn(( + ComponentRocketSound, + AudioBundle { + source: asset_server.load(ASSET_ROCKET), + settings: PlaybackSettings { + mode: PlaybackMode::Loop, + paused: true, + ..default() + }, + }, + )); commands.insert_resource(SoundClick(asset_server.load(ASSET_CLICK))); commands.insert_resource(SoundSwitch(asset_server.load(ASSET_SWITCH))); commands.insert_resource(SoundIncomingMessage(asset_server.load(ASSET_INCOMING_MESSAGE))); diff --git a/src/camera.rs b/src/camera.rs index 356a3c6..5df76e0 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -52,6 +52,7 @@ fn run_camera_controller( mut mouse_events: EventReader, key_input: Res>, thruster_sound_controller: Query<&AudioSink, With>, + rocket_sound_controller: Query<&AudioSink, With>, q_engine: Query<&actor::Engine, With>, mut query: Query<(&mut Transform, &mut CameraController, &mut actor::Actor, &actor::Engine), With>, ) { @@ -156,7 +157,14 @@ fn run_camera_controller( } if let Ok(sink) = thruster_sound_controller.get_single() { - if play_thruster_sound { + if play_thruster_sound && engine.engine_type == actor::EngineType::Monopropellant { + sink.play() + } else { + sink.pause() + } + } + if let Ok(sink) = rocket_sound_controller.get_single() { + if play_thruster_sound && engine.engine_type == actor::EngineType::Rocket { sink.play() } else { sink.pause() diff --git a/src/defs.txt b/src/defs.txt index de3f4e9..83b8b58 100644 --- a/src/defs.txt +++ b/src/defs.txt @@ -81,6 +81,7 @@ actor 10 -30 20 bike scale 5 vehicle yes thrust 50 0 10 0.5 + engine rocket actor 10 0 70 suit name Icarus diff --git a/src/world.rs b/src/world.rs index 5ec6427..a941ac1 100644 --- a/src/world.rs +++ b/src/world.rs @@ -215,14 +215,12 @@ pub fn setup( }); } -#[derive(Debug)] enum DefClass { Actor, Chat, None, } -#[derive(Debug)] struct ParserState { class: DefClass, @@ -246,6 +244,7 @@ struct ParserState { thrust_sideways: f32, thrust_back: f32, reaction_wheels: f32, + engine_type: actor::EngineType, oxygen: f32, // Chat fields @@ -284,6 +283,7 @@ impl Default for ParserState { thrust_sideways: default_engine.thrust_forward, thrust_back: default_engine.thrust_back, reaction_wheels: default_engine.reaction_wheels, + engine_type: default_engine.engine_type, oxygen: nature::OXY_D, delay: 0.0, @@ -357,6 +357,7 @@ impl ParserState { thrust_back: self.thrust_back, thrust_sideways: self.thrust_sideways, reaction_wheels: self.reaction_wheels, + engine_type: self.engine_type, }; let component_suit = actor::Suit { oxygen: self.oxygen, @@ -557,6 +558,9 @@ pub fn load_defs( state.reaction_wheels = reaction_wheels_float; } } + ["engine", "rocket"] => { + state.engine_type = actor::EngineType::Rocket; + } // Parsing chats ["chat", chat_name] => {