diff --git a/src/gameplay/bounds.rs b/src/gameplay/bounds.rs index 751d37c..a4f85fc 100644 --- a/src/gameplay/bounds.rs +++ b/src/gameplay/bounds.rs @@ -2,7 +2,10 @@ use bevy::prelude::*; use crate::{ config::HALF_TERRAIN_WIDTH, - gameplay::{collision::Collider, player::Player}, + gameplay::{ + collision::Collider, + player::{Player, move_player}, + }, states::GameState, }; @@ -18,6 +21,11 @@ pub struct BoundsPlugin; impl Plugin for BoundsPlugin { 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)), + ); } }