state modifs

This commit is contained in:
2026-09-18 22:39:29 +02:00
parent 26448cd0a0
commit 8d496eee73
8 changed files with 64 additions and 98 deletions
+9 -3
View File
@@ -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)),
);
}
}