From ced7aa2ea5f29b91be10666d8f2e4ccb8096e748 Mon Sep 17 00:00:00 2001 From: Klemen Plestenjak Date: Thu, 9 Nov 2023 09:41:27 +0100 Subject: [PATCH] Tweak colliders depth and collider rendering --- assets/terrain.tsj | 36 ++++++++++++++++++------------------ engine/breeze/world/map.c | 8 +++----- engine/breeze/world/map.h | 2 +- tiled/terrain.tsx | 16 ++++++++-------- 4 files changed, 30 insertions(+), 32 deletions(-) diff --git a/assets/terrain.tsj b/assets/terrain.tsj index 1dae2e1..ebadd02 100644 --- a/assets/terrain.tsj +++ b/assets/terrain.tsj @@ -72,15 +72,15 @@ "name":"", "objects":[ { - "height":16, + "height":13, "id":1, "name":"", "rotation":0, "type":"", "visible":true, - "width":16, - "x":0, - "y":0 + "width":13, + "x":3, + "y":3 }], "opacity":1, "type":"objectgroup", @@ -99,7 +99,7 @@ "name":"", "objects":[ { - "height":16, + "height":13, "id":1, "name":"", "rotation":0, @@ -107,7 +107,7 @@ "visible":true, "width":16, "x":0, - "y":0 + "y":3 }], "opacity":1, "type":"objectgroup", @@ -126,15 +126,15 @@ "name":"", "objects":[ { - "height":16, + "height":13, "id":1, "name":"", "rotation":0, "type":"", "visible":true, - "width":16, + "width":13, "x":0, - "y":0 + "y":3 }], "opacity":1, "type":"objectgroup", @@ -293,8 +293,8 @@ "rotation":0, "type":"", "visible":true, - "width":16, - "x":0, + "width":13, + "x":3, "y":0 }], "opacity":1, @@ -358,7 +358,7 @@ "rotation":0, "type":"", "visible":true, - "width":16, + "width":13, "x":0, "y":0 }], @@ -544,14 +544,14 @@ "name":"", "objects":[ { - "height":16, + "height":13, "id":1, "name":"", "rotation":0, "type":"", "visible":true, - "width":16, - "x":0, + "width":13, + "x":3, "y":0 }], "opacity":1, @@ -571,7 +571,7 @@ "name":"", "objects":[ { - "height":16, + "height":13, "id":1, "name":"", "rotation":0, @@ -598,13 +598,13 @@ "name":"", "objects":[ { - "height":16, + "height":13, "id":1, "name":"", "rotation":0, "type":"", "visible":true, - "width":16, + "width":13, "x":0, "y":0 }], diff --git a/engine/breeze/world/map.c b/engine/breeze/world/map.c index e3e58d7..ac52cd5 100644 --- a/engine/breeze/world/map.c +++ b/engine/breeze/world/map.c @@ -258,17 +258,15 @@ void bzTileMapDrawColliders(BzTileMap *map) { switch (shape.type) { case BZ_TILE_SHAPE_NONE: - break; - case BZ_TILE_SHAPE_POINT: - DrawCircle(posX, posY, 1.0f, color); + default: break; case BZ_TILE_SHAPE_RECT: - DrawRectangle(posX, posY, sizeX, sizeY, color); + DrawRectangleLines(posX, posY, sizeX, sizeY, color); break; case BZ_TILE_SHAPE_ELLIPSE: sizeX *= 0.5f; sizeY *= 0.5f; - DrawEllipse(posX + sizeX, posY + sizeY, sizeX, sizeY, color); + DrawEllipseLines(posX + sizeX, posY + sizeY, sizeX, sizeY, color); break; } } diff --git a/engine/breeze/world/map.h b/engine/breeze/world/map.h index fe96069..c22c631 100644 --- a/engine/breeze/world/map.h +++ b/engine/breeze/world/map.h @@ -6,7 +6,7 @@ #define BZ_MAX_MAP_LAYERS 8 #define BZ_MAX_MAP_TILESETS 8 -#define BZ_MAP_COLLIDER_DEPTH 3 +#define BZ_MAP_COLLIDER_DEPTH 2 typedef struct BzTileLayer { diff --git a/tiled/terrain.tsx b/tiled/terrain.tsx index a7b7698..55ac78d 100644 --- a/tiled/terrain.tsx +++ b/tiled/terrain.tsx @@ -18,17 +18,17 @@ - + - + - + @@ -63,7 +63,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -115,17 +115,17 @@ - + - + - +