From b1f37e04b9b73b5a61606e66f70acbfbbd677d2f Mon Sep 17 00:00:00 2001 From: Waridley Date: Thu, 8 Feb 2024 14:31:23 -0600 Subject: [PATCH] Impact sfx --- rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg | 3 +++ rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg.meta | 7 +++++++ rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg | 3 +++ rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg.meta | 7 +++++++ rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg | 3 +++ rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg.meta | 7 +++++++ rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg | 3 +++ rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg.meta | 7 +++++++ rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg | 3 +++ rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg.meta | 7 +++++++ rs/src/enemies/dummy.rs | 3 ++- rs/src/player.rs | 7 +++++++ rs/src/player/abilities.rs | 1 + 13 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg.meta create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg.meta create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg.meta create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg.meta create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg create mode 100644 rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg.meta diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg b/rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg new file mode 100644 index 0000000..f596229 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:956c6612a256aa1a67a2327fffe2454f6b1d82e4c1c2be28fd66916335d5b1d6 +size 15491 diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg.meta b/rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg.meta new file mode 100644 index 0000000..f498067 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_000.ogg.meta @@ -0,0 +1,7 @@ +( + meta_format_version: "1.0", + asset: Load( + loader: "bevy_kira_audio::source::ogg_loader::OggLoader", + settings: (), + ), +) \ No newline at end of file diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg b/rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg new file mode 100644 index 0000000..735349d --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a2b76f20052819c6ace57cc5ba55ec58deffcf74e3ed30694d619c582cc8e8e +size 15305 diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg.meta b/rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg.meta new file mode 100644 index 0000000..f498067 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_001.ogg.meta @@ -0,0 +1,7 @@ +( + meta_format_version: "1.0", + asset: Load( + loader: "bevy_kira_audio::source::ogg_loader::OggLoader", + settings: (), + ), +) \ No newline at end of file diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg b/rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg new file mode 100644 index 0000000..ec0e6e7 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c1bb4db8a4d48b2b8c2e65a175d9056b845f1063837599995d81be1c5957d2c +size 12708 diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg.meta b/rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg.meta new file mode 100644 index 0000000..f498067 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_002.ogg.meta @@ -0,0 +1,7 @@ +( + meta_format_version: "1.0", + asset: Load( + loader: "bevy_kira_audio::source::ogg_loader::OggLoader", + settings: (), + ), +) \ No newline at end of file diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg b/rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg new file mode 100644 index 0000000..2a742f1 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef29c3943ee701616f65e3d596c13eb3ff6b11ca5b3ac01e7bc923366a5c6f76 +size 17303 diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg.meta b/rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg.meta new file mode 100644 index 0000000..f498067 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_003.ogg.meta @@ -0,0 +1,7 @@ +( + meta_format_version: "1.0", + asset: Load( + loader: "bevy_kira_audio::source::ogg_loader::OggLoader", + settings: (), + ), +) \ No newline at end of file diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg b/rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg new file mode 100644 index 0000000..cc53722 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0032710d1fc88c217946cd54492f275eb4363bb8025a4bc1b7ce08df7b3c60de +size 11290 diff --git a/rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg.meta b/rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg.meta new file mode 100644 index 0000000..f498067 --- /dev/null +++ b/rs/assets/sfx/Kenney/Audio/impactMetal_004.ogg.meta @@ -0,0 +1,7 @@ +( + meta_format_version: "1.0", + asset: Load( + loader: "bevy_kira_audio::source::ogg_loader::OggLoader", + settings: (), + ), +) \ No newline at end of file diff --git a/rs/src/enemies/dummy.rs b/rs/src/enemies/dummy.rs index 10bae2e..99a5b9f 100644 --- a/rs/src/enemies/dummy.rs +++ b/rs/src/enemies/dummy.rs @@ -13,7 +13,7 @@ use bevy::{ ecs::system::{EntityCommands, SystemParamItem}, prelude::*, }; -use bevy_kira_audio::Audio; +use bevy_kira_audio::{Audio, AudioControl}; use bevy_rapier3d::{ dynamics::LockedAxes, math::Vect, @@ -165,6 +165,7 @@ pub fn handle_hits( .copied() .and_then(|body| ctx.bodies.get_mut(body)) { + audio.play(sfx.impacts[0].clone()); body.set_locked_axes(rapier3d::prelude::LockedAxes::empty(), true); body.apply_impulse_at_point( Vector3::from(global.compute_transform().rotation * toi.normal2) * 2000.0, diff --git a/rs/src/player.rs b/rs/src/player.rs index ecadb53..a5edec3 100644 --- a/rs/src/player.rs +++ b/rs/src/player.rs @@ -132,6 +132,13 @@ pub fn setup( fire_a: asset_server.load("sfx/Kenney/Audio/laserSmall_004.ogg"), dash: asset_server.load("sfx/Kenney/Audio/forceField_000.ogg"), jump: asset_server.load("sfx/Kenney/Audio/forceField_002.ogg"), + impacts: [ + asset_server.load("sfx/Kenney/Audio/impactMetal_000.ogg"), + asset_server.load("sfx/Kenney/Audio/impactMetal_001.ogg"), + asset_server.load("sfx/Kenney/Audio/impactMetal_002.ogg"), + asset_server.load("sfx/Kenney/Audio/impactMetal_003.ogg"), + asset_server.load("sfx/Kenney/Audio/impactMetal_004.ogg"), + ], }); let ship_scene = asset_server.load("ships/player.glb#Scene0"); diff --git a/rs/src/player/abilities.rs b/rs/src/player/abilities.rs index 4c7417f..6c28b77 100644 --- a/rs/src/player/abilities.rs +++ b/rs/src/player/abilities.rs @@ -472,6 +472,7 @@ pub struct Sfx { pub aoe: Handle, pub dash: Handle, pub jump: Handle, + pub impacts: [Handle; 5], } #[derive(Component, Debug)]