use gamestates and assetloader
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user