add achievement sound effect
This commit is contained in:
parent
d20dc5c60d
commit
ac38a248fa
|
@ -40,6 +40,7 @@
|
|||
- https://pixabay.com/sound-effects/electric-fan-motor-blades-removed-13169
|
||||
- https://pixabay.com/sound-effects/whoosh-blow-flutter-shortwav-14678/
|
||||
- https://pixabay.com/sound-effects/dslr-camera-sounds-26117/
|
||||
- https://pixabay.com/sound-effects/beep-6-96243
|
||||
- Music: [Cinematic Cello](https://pixabay.com/music/build-up-scenes-cinematic-cello-115667) by [Aleksey Chistilin](https://pixabay.com/users/lexin_music-28841948/), [Pixabay Content License](https://pixabay.com/service/license-summary)
|
||||
- Star chart based on the [HYG Stellar database](https://github.com/astronexus/HYG-Database)
|
||||
- Font Yupiter-Regular.ttf is placed under the SIL OPEN FONT LICENSE Version 1.1 and is based on:
|
||||
|
|
BIN
assets/sounds/achieve.ogg
Normal file
BIN
assets/sounds/achieve.ogg
Normal file
Binary file not shown.
|
@ -41,6 +41,7 @@ const PATHS: &[(SfxType, Sfx, &str)] = &[
|
|||
(SfxType::LoopSfx, Sfx::Ion, "sounds/ion.ogg"),
|
||||
(SfxType::LoopSfx, Sfx::Rocket, "sounds/rocket.ogg"),
|
||||
(SfxType::LoopSfx, Sfx::Thruster, "sounds/thruster.ogg"),
|
||||
(SfxType::OneOff, Sfx::Achieve, "sounds/achieve.ogg"),
|
||||
(SfxType::OneOff, Sfx::Click, "sounds/click-button-140881-crop.ogg"),
|
||||
(SfxType::OneOff, Sfx::Connect, "sounds/connect.ogg"),
|
||||
(SfxType::OneOff, Sfx::Crash, "sounds/crash.ogg"),
|
||||
|
@ -55,6 +56,7 @@ const PATHS: &[(SfxType, Sfx, &str)] = &[
|
|||
|
||||
#[derive(Component, PartialEq, Hash, Eq, Copy, Clone)]
|
||||
pub enum Sfx {
|
||||
Achieve,
|
||||
BGM,
|
||||
Click,
|
||||
Connect,
|
||||
|
@ -74,6 +76,7 @@ pub enum Sfx {
|
|||
|
||||
pub fn str2sfx(sfx_label: &str) -> Sfx {
|
||||
return match sfx_label {
|
||||
"achieve" => Sfx::Achieve,
|
||||
"switch" => Sfx::Switch,
|
||||
"click" => Sfx::Click,
|
||||
"woosh" => Sfx::Woosh,
|
||||
|
|
|
@ -147,6 +147,7 @@ pub fn handle_game_event(
|
|||
}
|
||||
}
|
||||
GameEvent::Achievement(name) => {
|
||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Achieve));
|
||||
log.info(format!("Achievement accomplished: {name}!"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue