Path following
This commit is contained in:
@@ -18,18 +18,13 @@ bool initGameObjectsLayer(BzTileMap *map, BzTileObjectGroup *objectGroup) {
|
||||
}
|
||||
|
||||
bool initEntityObjectsLayer(BzTileMap *map, BzTileObjectGroup *objectGroup) {
|
||||
ECS_COMPONENT(ECS, Position);
|
||||
ECS_COMPONENT(ECS, Size);
|
||||
ECS_COMPONENT(ECS, Rotation);
|
||||
ECS_COMPONENT(ECS, TextureRegion);
|
||||
ECS_COMPONENT(ECS, Animation);
|
||||
|
||||
BzTileset *objectTileset = bzTileObjectGroupGetTileset(&GAME->map, objectGroup);
|
||||
if (!objectTileset) return true;
|
||||
|
||||
for (i32 i = 0; i < objectGroup->objectCount; i++) {
|
||||
BzTileObject object = objectGroup->objects[i];
|
||||
ecs_entity_t e = ecs_new_id(ECS);
|
||||
GAME->entity = e;
|
||||
ecs_set(ECS, e, Position, {object.shape.x, object.shape.y});
|
||||
ecs_set(ECS, e, Size, {object.shape.sizeX, object.shape.sizeY});
|
||||
ecs_set(ECS, e, Rotation, {0.0f});
|
||||
@@ -50,10 +45,6 @@ bool initEntityObjectsLayer(BzTileMap *map, BzTileObjectGroup *objectGroup) {
|
||||
}
|
||||
|
||||
bool initBuildingsLayer(BzTileMap *map, BzTileLayer *layer) {
|
||||
ECS_COMPONENT(ECS, TilePosition);
|
||||
ECS_COMPONENT(ECS, TileSize);
|
||||
ECS_COMPONENT(ECS, Owner);
|
||||
|
||||
GAME->entityMap = bzCalloc(sizeof(*GAME->entityMap), layer->width * layer->height);
|
||||
|
||||
BzTileLayer *ownershipLayer = layer;
|
||||
|
||||
Reference in New Issue
Block a user