Tweak colliders depth and collider rendering

This commit is contained in:
2023-11-09 09:41:27 +01:00
parent 913a365a21
commit ced7aa2ea5
4 changed files with 30 additions and 32 deletions

View File

@@ -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
}],

View File

@@ -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;
}
}

View File

@@ -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 {

View File

@@ -18,17 +18,17 @@
</tile>
<tile id="190" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="1" x="3" y="3" width="13" height="13"/>
</objectgroup>
</tile>
<tile id="191" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="1" x="0" y="3" width="16" height="13"/>
</objectgroup>
</tile>
<tile id="192" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="1" x="0" y="3" width="13" height="13"/>
</objectgroup>
</tile>
<tile id="194" type="river">
@@ -63,7 +63,7 @@
</tile>
<tile id="217" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="1" x="3" y="0" width="13" height="16"/>
</objectgroup>
</tile>
<tile id="218" type="river">
@@ -74,7 +74,7 @@
<tile id="219" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="2" x="0" y="0" width="16" height="16"/>
<object id="2" x="0" y="0" width="13" height="16"/>
</objectgroup>
</tile>
<tile id="220" type="river"/>
@@ -115,17 +115,17 @@
</tile>
<tile id="244" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="1" x="3" y="0" width="13" height="13"/>
</objectgroup>
</tile>
<tile id="245" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="1" x="0" y="0" width="16" height="13"/>
</objectgroup>
</tile>
<tile id="246" type="river">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/>
<object id="1" x="0" y="0" width="13" height="13"/>
</objectgroup>
</tile>
<tile id="248" type="river">