map tiles
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "../player.h"
|
||||
#include "../aabb.h"
|
||||
#include <SDL3/SDL_events.h>
|
||||
#include "../map.h"
|
||||
|
||||
void UpdateWorld(F32 delta, World *world)
|
||||
{
|
||||
@@ -33,6 +34,11 @@ void ProcessEvents(SDL_Event *event, World *world)
|
||||
}
|
||||
|
||||
void RenderWorld(World *world, D_Context *draw) {
|
||||
World_Tile tileTypes[] = {dirt, middlePath, middlePathEdgeTop, middlePathEdgeRight, middlePathEdgeBottom, middlePathEdgeLeft, middlePathCornerTopLeft, middlePathCornerTopRight, middlePathCornerBottomRight, middlePathCornerTurnBottomLeft};
|
||||
for (int i = 0; i < 4800; i++)
|
||||
{
|
||||
D_Rect(draw, (i % 96), __floor(i / 96), .texture = tileTypes[map[i]].tile, .angle = tileTypes[map[i]].rotation);
|
||||
}
|
||||
for(U32 i = 0; i < world->npcCount; i++) {
|
||||
NPC npc = world->npcs[i];
|
||||
if(npc.currentArea == world->player.currentArea) {
|
||||
|
||||
Reference in New Issue
Block a user