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:
2026-02-11 19:07:53 +01:00
co-authored by Claude Opus 4.6
parent 4ed15c1a38
commit 862ab9099f
3 changed files with 407 additions and 1 deletions
+7 -1
View File
@@ -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");
}