NPC movements
This commit is contained in:
@@ -41,10 +41,18 @@ errorret_t rpgInit(void) {
|
||||
uint8_t npcIndex = entityGetAvailable();
|
||||
entity_t *npc = &ENTITIES[npcIndex];
|
||||
entityInit(npc, ENTITY_TYPE_NPC);
|
||||
npcSetMoveType(npc, NPC_MOVE_TYPE_PATH);
|
||||
npc->position = (worldpos_t){ 3, 3, 0 };
|
||||
npc->interact.type = ENTITY_INTERACT_PRINT;
|
||||
npc->interact.data.message = "hello world";
|
||||
|
||||
npcpath_t *path = &npc->data.npc.moveData.path;
|
||||
path->positions[0] = (worldpos_t){ 3, 3, 0 };
|
||||
path->positions[1] = (worldpos_t){ 5, 3, 0 };
|
||||
path->positions[2] = (worldpos_t){ 5, 5, 0 };
|
||||
path->positions[3] = (worldpos_t){ 3, 5, 0 };
|
||||
path->count = 4;
|
||||
|
||||
// All Good!
|
||||
errorOk();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user