Files
ld58/code/game/npc.h

32 lines
586 B
C
Raw Normal View History

2025-10-04 21:08:52 +01:00
#if !defined(LD_GAME_NPC_H_)
#define LD_GAME_NPC_H_
#include "aabb.h"
2025-10-05 00:25:37 +01:00
#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,
};
2025-10-04 21:08:52 +01:00
typedef struct NPC NPC;
struct NPC {
AABB collision;
2025-10-05 00:25:37 +01:00
Str8 name;
NPC_ACTION mode;
F32 waitTime;
F32 maxWaitTime;
NavPath path;
U32 currentNavNode;
U32 pathIndex;
U32 targetNavNode;
F32 walkTimer;
2025-10-04 21:08:52 +01:00
};
#endif // LD_GAME_NPC_H_