feat: Basic NPC wandering

This commit is contained in:
2025-10-05 00:25:37 +01:00
parent 249109f117
commit ab96fa3eeb
7 changed files with 35129 additions and 5 deletions

View File

@@ -1,10 +1,31 @@
#if !defined(LD_GAME_NPC_H_)
#define LD_GAME_NPC_H_
#include "aabb.h"
#include "nav.h"
#include "../core/types.h"
#define NPC_SPEED 0.2
typedef enum NPC_ACTION NPC_ACTION;
enum NPC_ACTION {
// Waiting can be at any point of interest
NPC_ACTION_WAITING,
// Walking is when they are actively moving somewhere
NPC_ACTION_WALKING,
};
typedef struct NPC NPC;
struct NPC {
AABB collision;
Str8 name;
NPC_ACTION mode;
F32 waitTime;
F32 maxWaitTime;
NavPath path;
U32 currentNavNode;
U32 pathIndex;
U32 targetNavNode;
F32 walkTimer;
};
#endif // LD_GAME_NPC_H_