Add collider map
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#define BZ_MAX_MAP_LAYERS 8
|
||||
#define BZ_MAX_MAP_TILESETS 8
|
||||
#define BZ_MAP_COLLIDER_DEPTH 3
|
||||
|
||||
|
||||
typedef struct BzTileLayer {
|
||||
@@ -58,6 +59,10 @@ typedef struct BzTileMapDesc {
|
||||
BzTileObjectsDesc objectLayers[BZ_MAX_MAP_LAYERS];
|
||||
} BzTileMapDesc;
|
||||
|
||||
typedef struct BzTileCollider {
|
||||
BzTileShape shapes[BZ_MAP_COLLIDER_DEPTH];
|
||||
} BzTileCollider;
|
||||
|
||||
typedef struct BzTileMap {
|
||||
Color backgroundColor;
|
||||
|
||||
@@ -66,6 +71,9 @@ typedef struct BzTileMap {
|
||||
i32 tileWidth;
|
||||
i32 tileHeight;
|
||||
|
||||
BzTileCollider *colliderMap;
|
||||
i32 collidersCount;
|
||||
|
||||
BzTileLayer layers[BZ_MAX_MAP_LAYERS];
|
||||
i32 layerCount;
|
||||
|
||||
@@ -86,7 +94,9 @@ BzTileMap bzTileMapCreate(const BzTileMapDesc *desc);
|
||||
void bzTileMapDestroy(BzTileMap *tilemap);
|
||||
|
||||
void bzTileMapDraw(BzTileMap *map);
|
||||
void bzTileMapDrawColliders(BzTileMap *map);
|
||||
bool bzTileMapCanPlace(BzTileMap *map, i32 tileX, i32 tileY, i32 sizeX, i32 sizeY);
|
||||
BzTileCollider bzTileMapGetCollider(BzTileMap *map, i32 x, i32 y);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user