Update to use game_tileset.h

This commit is contained in:
2023-12-13 15:37:41 +01:00
parent 20aee8ffae
commit ce519fe409
14 changed files with 411 additions and 374 deletions

View File

@@ -31,8 +31,8 @@ bool canPlaceBuilding(BzTileMap *map, BuildingType type, BzTile tileX, BzTile ti
BzTile tile = bzTileLayerGetTile(buildLayer, x, y);
tile = bzTilesetGetTile(tileset, tile);
tile = getTileBuilding(tile);
if (tile == BUILDINGS_ROAD)
return false;
//if (tile == BUILDINGS_ROAD)
// return false;
if (bzTileMapHasCollision(map, x, y)) {
return false;
}
@@ -57,7 +57,7 @@ ecs_entity_t placeBuilding(BzTileMap *map, BuildingType type, BzTile tileX, BzTi
ecs_set(ECS, e, TilePosition, { .x = tileX, .y = tileY });
ecs_set(ECS, e, TileSize, { .sizeX = sizeX, .sizeY = sizeY });
ecs_set(ECS, e, Owner, { .playerID = BUILDINGS_PLAYER_RED });
//ecs_set(ECS, e, Owner, { .playerID = BUILDINGS_PLAYER_RED });
for (i32 y = tileY; y < tileY + sizeY; y++) {
for (i32 x = tileX; x < tileX + sizeX; x++) {