Pathfinding and re-pickup of the project
This commit is contained in:
+7
-8
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user