bounds issue fixed

This commit is contained in:
2026-09-20 17:39:13 +02:00
parent c043487079
commit 1946458807
+10 -2
View File
@@ -2,7 +2,10 @@ use bevy::prelude::*;
use crate::{ use crate::{
config::HALF_TERRAIN_WIDTH, config::HALF_TERRAIN_WIDTH,
gameplay::{collision::Collider, player::Player}, gameplay::{
collision::Collider,
player::{Player, move_player},
},
states::GameState, states::GameState,
}; };
@@ -18,6 +21,11 @@ pub struct BoundsPlugin;
impl Plugin for BoundsPlugin { impl Plugin for BoundsPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
app.add_systems(Update, constrain_player.run_if(in_state(GameState::InGame))); app.add_systems(
Update,
constrain_player
.after(move_player)
.run_if(in_state(GameState::InGame)),
);
} }
} }