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
+7 -2
View File
@@ -1,6 +1,7 @@
use bevy::prelude::*;
use crate::{
game_state::GameState,
obstacle::Obstacle,
player::{Player, move_player},
};
@@ -52,7 +53,11 @@ pub struct CollisionPlugin;
impl Plugin for CollisionPlugin {
fn build(&self, app: &mut App) {
app.init_resource::<HasCollided>()
.add_systems(Update, check_collision_with_player.after(move_player));
app.init_resource::<HasCollided>().add_systems(
Update,
check_collision_with_player
.run_if(in_state(GameState::InGame))
.after(move_player),
);
}
}