feat: Added portals

This commit is contained in:
2025-10-06 21:07:55 +01:00
parent be49003a8d
commit 680d375b8c
9 changed files with 158 additions and 33 deletions

View File

@@ -2,19 +2,21 @@
#define LD_GAME_WORLD_H_
#include "../core/math.h"
#include "./aabb.h"
#define WORLD_HITBOX_MAX 4096
#define WORLD_PROP_MAX 2048
#define WORLD_PROP_TYPE_MAX 64
#define WORLD_TILE_TYPE_MAX 64
#define WORLD_MAP_MAX 4800
#define WORLD_PORTAL_MAX 64
// Areas are which
typedef U32 World_Area;
enum World_Area
{
WORLD_AREA_OUTSIDE = (1 << 0),
WORLD_AREA_SALOON = (1 << 1),
WORLD_AREA_OUTSIDE = 1,
WORLD_AREA_SALOON = 2,
};
typedef struct World_Tile World_Tile;
@@ -37,6 +39,13 @@ struct World_Prop
V2f pos;
};
typedef struct World_Portal World_Portal;
struct World_Portal
{
AABB box;
World_Area area;
};
typedef struct World World;
#include "player.h"
#include "npc.h"
@@ -54,11 +63,14 @@ struct World {
World_PropType *propTypes;
World_Prop *props;
AABB *hitboxes;
World_Portal *portals;
U32 *map;
U32 propCount;
U32 portalCount;
U32 hitboxCount;
//// Player
Player player;