Pathfinding and re-pickup of the project

This commit is contained in:
2026-07-16 21:08:30 +02:00
parent 5c8494961c
commit 674cf91ef3
7 changed files with 344 additions and 19 deletions
+7 -8
View File
@@ -64,14 +64,13 @@ impl TileMap {
}
}
/// Gameplay flags for a global tile id. Hand-maintained vocabulary — extend as the
/// tileset grows. Unknown ids default to a plain walkable floor tile.
///
/// Tile ids correspond to indices into `overworld.tga` on the client side.
/// Gameplay flags for a global tile id. Collision comes from the shared movement
/// vocabulary (`shared::tile_collidable`) so the client can predict it identically;
/// other flags (opaque, …) stay server-side. Tile ids index into `overworld.tga`.
pub fn tile_flags(tile_id: u16) -> TileFlags {
match tile_id {
// TODO: fill in collidable / opaque tiles from overworld.tga, e.g.
// 146 => TileFlags(TileFlags::COLLIDABLE | TileFlags::OPAQUE),
_ => TileFlags::default(),
let mut bits = 0u8;
if shared::tile_collidable(tile_id) {
bits |= TileFlags::COLLIDABLE;
}
TileFlags(bits)
}