Polish up AI

This commit is contained in:
2024-02-13 19:01:51 +01:00
parent 417cf081d7
commit dcd4d1940d
6 changed files with 40 additions and 22 deletions

View File

@@ -263,8 +263,12 @@ void inputUnitAction(Game *game, InputState *input) {
for (i32 i = 0; i < unitIdx; i++) {
ecs_entity_t entity = entities[i].entity;
setAIBehaviour(entity, game->BTs.unit, &(AIBlackboard) {
BzBTNode *BT = game->BTs.unit;
if (ecs_has(ECS, entity, Worker))
BT = game->BTs.unitEvasive;
setAIBehaviour(entity, BT, &(AIBlackboard) {
.moveToPos = positions[i],
.shouldMoveTo = true,
.proximity = 1.0f,
});
}

View File

@@ -406,11 +406,11 @@ void drawMainMenuUI(Game *game, f32 dt) {
if (uiMainMenuButton("Play", true)) {
setScreen(game, SCREEN_GAME);
unloadMap(game);
loadMap(game, "assets/maps/tree_test.tmj", false);
//loadMap(game, "assets/maps/tree_test.tmj", false);
//loadMap(game, "assets/maps/entity_test.tmj", false);
//loadMap(game, "assets/maps/worker_test.tmj", false);
//loadMap(game, "assets/maps/battle_test.tmj", false);
//loadMap(game, "assets/maps/map_01.tmj", false);
loadMap(game, "assets/maps/map_01.tmj", false);
}
if (uiMainMenuButton("Settings", true)) {
setScreen(game, SCREEN_SETTINGS);