feat: Player controller

This commit is contained in:
2025-10-05 18:05:01 +01:00
parent 98095c907f
commit e20e537e97
9 changed files with 89 additions and 47 deletions

View File

@@ -6,6 +6,7 @@
void UpdateWorld(F32 delta, World *world)
{
UpdateNPCs(delta, world);
PlayerUpdate(delta, &world->player);
}
void UpdateNPCs(F32 delta, World *world)
@@ -18,11 +19,12 @@ void UpdateNPCs(F32 delta, World *world)
void ProcessEvents(SDL_Event *event, World *world)
{
PlayerUpdate(event, &world->player);
PlayerInput(event, &world->player);
}
void RenderWorld(World *world, D_Context *draw) {
for(int i = 0; i < world->npcCount; i++) {
D_Rect(draw, world->npcs[i].collision.pos.x, world->npcs[i].collision.pos.y, .texture = 1);
}
D_Rect(draw, world->player.pos.x, world->player.pos.y, .texture = 1);
}