Add 8 layers to collisions

This commit is contained in:
2024-01-13 08:09:34 +01:00
parent 0118e574de
commit 8692d89479
10 changed files with 76 additions and 61 deletions

View File

@@ -95,7 +95,7 @@ void unloadMap(Game *game) {
void loadMap(Game *game, const char *path) {
game->map = bzTileMapCreate(&(BzTileMapDesc) {
.path=path,
.generateCollisionMap=true,
.collisionMap=true,
.tilesets[0]=game->tileset,
.layers[LAYER_TERRAIN]=(BzTileLayerDesc) {"terrain", .renderer=terrainRender, .applyColliders=true},
@@ -123,6 +123,8 @@ void loadMap(Game *game, const char *path) {
game->camera.rotation = 0.0f;
game->camera.zoom = 3.0f;
bzTileMapAddLayerCollisions(&game->map, LAYER_TERRAIN, COLL_LAYER_TERRAIN);
bzTileMapOverrideLayer(&game->map, LAYER_TREES, initTreesLayer);
bzTileMapOverrideLayer(&game->map, LAYER_TREES2, initTreesLayer);