feat: square cells (16x16), slope stepping collision
Square cells: - CHAR_W and CHAR_H both 16 (was 8x16, non-square) - Window size updated to 160*16 x 50*16 = 2560x800 - Applies to both ascii and graphics renderers Slope stepping collision: - Before resolving X, check if new position overlaps solid - If overlap, try stepping up 1 cell — if clear, snap up (walk up slope) - If can't step up, resolve X normally (wall block) - aabb_overlaps_solid() helper for fast overlap check - Player can now walk up 1-cell-high steps and slopes 109 tests, 0 failures
This commit is contained in:
@@ -8,7 +8,7 @@ use crate::world::cell::MaterialId;
|
||||
use crate::world::grid::Grid;
|
||||
use crate::world::material::MaterialRegistry;
|
||||
|
||||
const CHAR_W: u32 = 8;
|
||||
const CHAR_W: u32 = 16;
|
||||
const CHAR_H: u32 = 16;
|
||||
const ATLAS_COLS: usize = 16;
|
||||
const ATLAS_ROWS: usize = 16;
|
||||
|
||||
Reference in New Issue
Block a user