Add weapons

This commit is contained in:
2024-01-06 19:54:22 +01:00
parent dbc0ce5981
commit f667614cfe
398 changed files with 1209 additions and 66 deletions

View File

@@ -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;
}