diff --git a/.gitignore b/.gitignore index eb5a316..7fe30d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ target +assets/raw +assets/restricted diff --git a/assets/sounds/wakeup.ogg b/assets/sounds/wakeup.ogg new file mode 100644 index 0000000..e6c82d8 Binary files /dev/null and b/assets/sounds/wakeup.ogg differ diff --git a/src/main.rs b/src/main.rs index 4a7766c..365bab1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,6 +40,10 @@ const CUBEMAPS: &[(&str, CompressedImageFormats)] = &[ ), ]; +#[derive(Resource)] +struct SoundInhale(Handle); + + fn setup( mut commands: Commands, asset_server: Res, @@ -51,6 +55,23 @@ fn setup( window.cursor.visible = false; window.mode = WindowMode::Fullscreen; } + + // Sound + let inhale_sound = asset_server.load("sounds/wakeup.ogg"); + let res_inhale_sound = SoundInhale(inhale_sound); + //commands.insert_resource(res_inhale_sound); + commands.spawn(AudioBundle { + source: res_inhale_sound.0.clone(), + // auto-despawn the entity when playback finishes + settings: PlaybackSettings::DESPAWN, + }); + commands.spawn(AudioBundle { + source: asset_server.load("restricted/FTL - Faster Than Light (2012) OST - 12 - Void (Explore)-edQw2yYXQJM.ogg"), + ..default() + }); + + + // camera commands.spawn(( Camera3dBundle {