feat: initial bandit and more npc tweaks

This commit is contained in:
2025-10-05 14:42:19 +01:00
parent 175f4da59b
commit 1f97d81133
8 changed files with 212 additions and 27 deletions

View File

@@ -2,9 +2,10 @@
#define LD_GAME_NPC_H_
#include "aabb.h"
#include "nav.h"
#include "npc_look.h"
#include "../core/types.h"
#define NPC_SPEED 0.2
#define NPC_SPEED 0.1
typedef enum NPC_ACTION NPC_ACTION;
enum NPC_ACTION {
@@ -14,18 +15,36 @@ enum NPC_ACTION {
NPC_ACTION_WALKING,
};
typedef struct NPC NPC;
struct NPC {
//// Personal
AABB collision;
Str8 name;
NPC_LOOK look;
//// Actions
NPC_ACTION mode;
// How long they've been waiting
F32 waitTime;
// How long they will wait until changing action
F32 maxWaitTime;
//// Navigation
// The NPC's current path
NavPath path;
// Which node the NPC is on in the path
U32 currentNavNode;
// The current index of the NPC's current node
U32 pathIndex;
// Target navNode index the npc is walking to
U32 targetNavNode;
// How long the npc has been walking to the next index
F32 walkTimer;
//// Knowledge
// What the NPC knows about the bandit.
NPC_LOOK banditKnowledge;
};
#endif // LD_GAME_NPC_H_