add head-drop and collect sound
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
GameState, billboards::Billboard, global_observer, loading_assets::GameAssets, player::Player,
|
||||
squish_animation::SquishAnimation,
|
||||
sounds::PlaySound, squish_animation::SquishAnimation,
|
||||
};
|
||||
use avian3d::prelude::*;
|
||||
use bevy::prelude::*;
|
||||
@@ -28,6 +28,8 @@ fn on_head_drop(trigger: Trigger<HeadDrops>, mut commands: Commands, assets: Res
|
||||
let angle = rand::random::<f32>() * PI * 2.;
|
||||
let spawn_dir = Quat::from_rotation_y(angle) * Vec3::new(0.5, 0.6, 0.).normalize();
|
||||
|
||||
commands.trigger(PlaySound::HeadDrop);
|
||||
|
||||
commands
|
||||
.spawn((
|
||||
Name::new("headdrop"),
|
||||
@@ -64,7 +66,7 @@ fn collect_head(
|
||||
|
||||
let key = query_collectable.get(collectable).unwrap();
|
||||
|
||||
// commands.trigger(PlaySound::KeyCollect);
|
||||
commands.trigger(PlaySound::HeadCollect);
|
||||
commands.trigger(HeadCollected(key.0));
|
||||
commands.entity(collectable).despawn_recursive();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user