state modifs
This commit is contained in:
+9
-3
@@ -1,6 +1,9 @@
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::player::{Player, START_POSITION, move_player};
|
||||
use crate::{
|
||||
game_state::GameState,
|
||||
player::{Player, START_POSITION, move_player},
|
||||
};
|
||||
|
||||
#[derive(Resource, Default)]
|
||||
pub struct Depth(pub f32);
|
||||
@@ -49,7 +52,10 @@ impl Plugin for ScorePlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_systems(Startup, spawn_depth_text)
|
||||
.init_resource::<Depth>()
|
||||
.add_systems(Update, update_depth.after(move_player))
|
||||
.add_systems(Update, update_depth_text);
|
||||
.add_systems(
|
||||
Update,
|
||||
(update_depth_text, update_depth.after(move_player))
|
||||
.run_if(in_state(GameState::InGame)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user