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