Add entity_factory

This commit is contained in:
2024-01-04 16:40:39 +01:00
parent c83f0fb666
commit cc6b1c1a35
7 changed files with 81 additions and 48 deletions

View File

@@ -1,6 +1,7 @@
#include "buildings.h"
#include "components.h"
#include "entity_factory.h"
#include "game_state.h"
#include "map_layers.h"
@@ -55,7 +56,7 @@ ecs_entity_t placeBuilding(BzTileMap *map, BuildingType type, BzTile tileX, BzTi
BZ_ASSERT(buildingTile != -1);
// Create entity
ecs_entity_t e = entityCreate(ECS);
ecs_entity_t e = entityCreateEmpty();
ecs_set(ECS, e, TilePosition, { .x = tileX, .y = tileY });
ecs_set(ECS, e, TileSize, { .sizeX = sizeX, .sizeY = sizeY });