Add weapons
This commit is contained in:
@@ -18,6 +18,7 @@ ecs_entity_t entityCreateWorker(const Position position, Game *game) {
|
||||
size.x, size.y);
|
||||
ecs_set(ECS, e, SpatialGridID, { spatialID });
|
||||
ecs_set(ECS, e, Rotation, { 0.0f });
|
||||
ecs_set(ECS, e, Orientation, {0.0f});
|
||||
ecs_set(ECS, e, Velocity, {});
|
||||
ecs_set(ECS, e, Steering, {});
|
||||
TextureRegion workerRegion = {
|
||||
@@ -46,5 +47,19 @@ ecs_entity_t entityCreateWorker(const Position position, Game *game) {
|
||||
.depositSpeed = 0.2f,
|
||||
.carryCapacity = 5,
|
||||
});
|
||||
|
||||
ecs_entity_t right = entityCreateEmpty();
|
||||
Arms arms = {.primary = right};
|
||||
ecs_set_ptr(ECS, e, Arms, &arms);
|
||||
ecs_set(ECS, right, Arm, {.offset = 45.0f, 4.5f});
|
||||
|
||||
ecs_set(ECS, right, Size, {8, 8});
|
||||
ecs_set(ECS, right, Rotation, { 0.0f });
|
||||
TextureRegion daggerRegion = {
|
||||
tileset->tiles,
|
||||
bzTilesetGetTileRegion(tileset, getItemTile(ITEM_AXE))
|
||||
};
|
||||
ecs_set_ptr(ECS, right, TextureRegion, &daggerRegion);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user