Pathfinding and re-pickup of the project
This commit is contained in:
@@ -32,6 +32,18 @@ pub fn chunk_coords(id: u32) -> (i16, i16) {
|
||||
(id as u16 as i16, (id >> 16) as u16 as i16)
|
||||
}
|
||||
|
||||
/// Shared movement vocabulary: whether a tile id blocks movement.
|
||||
///
|
||||
/// Single source of truth for both the server (collision in the sim) and the client
|
||||
/// (movement prediction). Keep this in lockstep with the tileset in `overworld.tga`.
|
||||
/// Currently every authored tile is walkable.
|
||||
pub fn tile_collidable(tile_id: u16) -> bool {
|
||||
match tile_id {
|
||||
// e.g. 146 => true, // trees / rocks
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Pod, Zeroable)]
|
||||
#[repr(C, packed)]
|
||||
pub struct Header {
|
||||
|
||||
Reference in New Issue
Block a user