Implement farming
This commit is contained in:
@@ -106,13 +106,20 @@ void inputUnitAction(Game *game, InputState *input) {
|
||||
ecs_entity_t entity = it.entities[i];
|
||||
Position target = *ecs_get(ECS, taskEntity, Position);
|
||||
|
||||
f32 proximity = 6.0f;
|
||||
if (resource.type == RES_FOOD)
|
||||
proximity = 2.0f;
|
||||
|
||||
Worker *worker = ecs_get_mut(ECS, entity, Worker);
|
||||
worker->carryRes = resource.type;
|
||||
|
||||
setAIBehaviour(entity, game->BTs.workerHarvest, &(AIBlackboard) {
|
||||
.as.worker = {
|
||||
.harvestType = resource.type,
|
||||
.harvestTarget = taskEntity,
|
||||
.harvestPos = target,
|
||||
},
|
||||
.proximity = 6.0f,
|
||||
.proximity = proximity,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ void drawGameUI(Game *game, f32 dt) {
|
||||
BUILDING_WAREHOUSE,
|
||||
BUILDING_MARKET,
|
||||
BUILDING_MILL,
|
||||
BUILDING_HOUSE_02, // placeholder for farm
|
||||
BUILDING_WHEAT_0,
|
||||
BUILDING_BARRACKS,
|
||||
BUILDING_ARCHERY_RANGE
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user