feat: Basic NPC wandering
This commit is contained in:
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user