Rework pathfinding to use Vector2, form formations

This commit is contained in:
2023-11-23 12:01:42 +01:00
parent 513168825c
commit 0dc8046d8f
6 changed files with 129 additions and 85 deletions

View File

@@ -285,6 +285,12 @@ void bzTileMapDestroy(BzTileMap *map) {
*map = BZ_TILEMAP_INVALID;
}
void bzTileMapPosToTile(BzTileMap *map, Vector2 pos, BzTile *x, BzTile *y) {
if (x) *x = (BzTile) (pos.x / (f32) map->tileWidth);
if (y) *y = (BzTile) (pos.y / (f32) map->tileHeight);
}
void bzTileMapOverrideLayer(BzTileMap *map, i32 slotID, BzTileLayerFunc func) {
BZ_ASSERT(slotID >= 0 && slotID < map->layerCount);
BzTileLayer *layer = map->layers + slotID;