feat: Initial bandit roaming

This commit is contained in:
2025-10-05 21:05:29 +01:00
parent b8f47b8f61
commit 635e7b1c1e
8 changed files with 104 additions and 23 deletions

View File

@@ -18,6 +18,7 @@
#include "game/impl/world.c"
#include "game/impl/npc.c"
#include "game/impl/bandit.c"
#include "game/testnavmesh.h"
int main(int argc, char **argv)
@@ -66,13 +67,13 @@ int main(int argc, char **argv)
World *world = M_ArenaPush(arena, World);
game->world = world;
world->random = Random_Seed(29237489723847);
world->npcCount = 100;
world->npcCount = 1;
for(int i = 0; i < world->npcCount; i++) {
NPC *npc1 = &world->npcs[i];
npc1->collision.pos.x = 15;
npc1->collision.pos.y = 15;
npc1->collision.size.x = 10;
npc1->collision.size.y = 10;
npc1->collision.size.x = 1;
npc1->collision.size.y = 1;
npc1->name = S("Matt");
npc1->mode = NPC_ACTION_WAITING;
npc1->waitTime = 0;
@@ -84,21 +85,25 @@ int main(int argc, char **argv)
npc1->collision.size.y = 10;
}
NPC *npc2 = &world->npcs[1];
npc2->collision.pos.x = 15;
npc2->collision.pos.y = 15;
npc2->collision.size.x = 10;
npc2->collision.size.y = 10;
npc2->name = S("James");
npc2->mode = NPC_ACTION_WAITING;
npc2->waitTime = 0;
npc2->maxWaitTime = 10;
npc2->currentNavNode = 0;
Bandit *badman = &world->bandit;
badman->collision.pos.x = 15;
badman->collision.pos.y = 15;
badman->collision.size.x = 10;
badman->collision.size.y = 10;
badman->name = S("Leroy Brown");
badman->mode = BANDIT_WAITING;
badman->waitTime = 0;
badman->maxWaitTime = 2;
badman->poiCount = 2;
badman->pointsOfInterest[0] = 937;
badman->pointsOfInterest[1] = 12;
world->navMesh = &TestNavMesh;
world->npcPOI[0] = 100;
world->player.pos.x = 0;
world->player.pos.y = 0;
world->player.bulletsLoaded = PLAYER_BULLET_COUNT;
world->player.reloadTimer = 0;
}
bool running = true;