feat(simulation): add tile collision system (#236)
TilePosition component with discrete grid coordinates, flat-storage WalkabilityMap resource with O(1) can_move_to() lookup, MoveIntent component and validate_movement system. Movement validated against walkability map each tick, blocking all NPC and player movement through unwalkable tiles. 11 unit tests + 1 integration test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
// Implements deterministic tick-based simulation (D-010 principle 4)
|
||||
|
||||
use bevy_app::prelude::*;
|
||||
use bevy_ecs::schedule::IntoScheduleConfigs;
|
||||
|
||||
pub mod input;
|
||||
pub mod movement;
|
||||
pub mod rng;
|
||||
pub mod tier;
|
||||
pub mod time;
|
||||
@@ -18,7 +20,11 @@ impl Plugin for SimulationPlugin {
|
||||
app.init_resource::<time::SimulationTime>()
|
||||
.insert_resource(rng::SimRng::new(0))
|
||||
.init_resource::<input::InputQueue>()
|
||||
.add_systems(Update, time::advance_tick);
|
||||
.add_systems(Update, time::advance_tick)
|
||||
.add_systems(
|
||||
Update,
|
||||
movement::validate_movement.after(time::advance_tick),
|
||||
);
|
||||
|
||||
tracing::debug!("SimulationPlugin initialized");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user