game states cleanup

This commit is contained in:
2026-09-19 10:53:36 +02:00
parent 9df830bf18
commit d42f5af75f
7 changed files with 74 additions and 20 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
use bevy::prelude::*;
use crate::{camera::MainCamera, collision::Collider, player::Player};
use crate::{camera::MainCamera, collision::Collider, game_state::GameState, player::Player};
fn constrain_player(
mut player: Single<(&Collider, &mut Transform), With<Player>>,
@@ -20,6 +20,6 @@ pub struct BoundsPlugin;
impl Plugin for BoundsPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, constrain_player);
app.add_systems(Update, constrain_player.run_if(in_state(GameState::InGame)));
}
}