Files
ld58/code/game/impl/world.c

40 lines
761 B
C
Raw Normal View History

#include "../world.h"
#include "../npc.h"
#include "../player.h"
#include <SDL3/SDL_events.h>
void UpdateWorld(F32 delta, World *world) {
UpdateNPCs(delta, world);
}
void UpdateNPCs(F32 delta, World *world) {
for(U32 i = 0; i < world->npcCount; i++) {
updateNPC(delta, &world->npcs[i], world);
}
}
void ProcessEvents(SDL_Event *event, World *world) {
PlayerUpdate(event, &world->player);
}
void G_WorldDraw(G_State *game, World *world) {
D_Context *draw = &game->draw;
(void) world;
for (F32 y = -128; y < 128; y += 1.1f) {
for (F32 x = -128; x < 128; x += 1.1f) {
U32 ux = (U32) x;
U32 uy = (U32) y;
U32 tid = 15;
if ((ux % 11) == 0 || ((uy % 7) == 0)) {
tid = 16;
}
D_Rect(draw, x, y, .texture = tid);
}
}
}