gate sound

volume down on music
This commit is contained in:
2025-03-09 20:22:35 +01:00
parent da7bbaa64a
commit 7bc6995e18
4 changed files with 23 additions and 1 deletions

View File

@@ -17,14 +17,27 @@ pub fn plugin(app: &mut App) {
}
fn update(
mut commands: Commands,
keyboard: Res<ButtonInput<KeyCode>>,
mut state: ResMut<GatesState>,
mut names_entities: Query<(&NamedEntity, &mut Transform)>,
asset_server: Res<AssetServer>,
) {
if keyboard.just_pressed(KeyCode::Digit1) {
if matches!(*state, GatesState::Init) {
*state = GatesState::GateOpen1;
//TODO: put into a sound effects system
commands.spawn((
AudioPlayer::new(asset_server.load("sfx/effects/gate.ogg")),
PlaybackSettings::DESPAWN,
));
//TODO: put into actual key collect once we have that
commands.spawn((
AudioPlayer::new(asset_server.load("sfx/effects/key_collect.ogg")),
PlaybackSettings::DESPAWN,
));
let fences: HashMap<_, _> = vec![
("fence_01", Quat::from_rotation_y(PI / -2.)),
("fence_02", Quat::from_rotation_y(PI / 2.)),