state modifs
This commit is contained in:
+7
-2
@@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user