ExCollision.Protocols.TileSource protocol (ExCollision v1.1.0)

View Source

Protocol for tile grid sources (TMX layer, world tilemap). Provides tile GID by coordinates and walkability checks.

Summary

Types

t()

All the types that implement this protocol.

Functions

Height in tiles

Tile GID by index (column + row * width), 0 = empty

Whether tile is walkable (not a wall) for pathfinding. Default: gid == 0 is walkable

Width in tiles

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

height(source)

Height in tiles

tile_at(source, index)

Tile GID by index (column + row * width), 0 = empty

walkable?(source, index)

Whether tile is walkable (not a wall) for pathfinding. Default: gid == 0 is walkable

width(source)

Width in tiles