use gamestates and assetloader

This commit is contained in:
2025-03-26 02:18:40 +01:00
parent 9842148010
commit ac87da83d8
25 changed files with 245 additions and 123 deletions

View File

@@ -1,5 +1,6 @@
use crate::{
billboards::Billboard, player::Player, sounds::PlaySound, squish_animation::SquishAnimation,
GameState, billboards::Billboard, player::Player, sounds::PlaySound,
squish_animation::SquishAnimation,
};
use avian3d::prelude::*;
use bevy::prelude::*;
@@ -16,7 +17,7 @@ struct Key(pub String);
pub struct KeyCollected(pub String);
pub fn plugin(app: &mut App) {
app.add_systems(Update, collect_key);
app.add_systems(Update, collect_key.run_if(in_state(GameState::Playing)));
app.add_observer(on_spawn);
}