feat: Player controller
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user