litiengine icon indicating copy to clipboard operation
litiengine copied to clipboard

Implement support for tileset collision

Open steffen-wilke opened this issue 4 years ago • 2 comments

Currently, we don't support tileset collision information configured in Tiled.

image

In the end, this results in an objectgroup XML element in the tileset (.tsx).

Example tileset:

<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.2" tiledversion="1.2.3" name="tileset" tilewidth="8" tileheight="8" tilecount="256" columns="16">
 <image source="tileset.png" width="128" height="128"/>
 <tile id="7">
  <animation>
   <frame tileid="7" duration="300"/>
   <frame tileid="8" duration="100"/>
  </animation>
 </tile>
 <tile id="21">
  <objectgroup draworder="index">
   <object id="4" x="0" y="0" width="8" height="8"/>
  </objectgroup>
 </tile>
 <tile id="37">
  <objectgroup draworder="index">
   <object id="2" x="0" y="0" width="8" height="8"/>
  </objectgroup>
 </tile>
</tileset>

Once we support this, we should also think about generating static CollisionBoxes from it when loading a map.

This was originally reported in our community forum: https://forum.litiengine.com/d/118-customise-movement-to-repeat-until-stopped

steffen-wilke avatar Apr 10 '20 11:04 steffen-wilke

I think, more generally, we need to update the engine to support Tiled 1.3.

TheRamenChef avatar Apr 13 '20 14:04 TheRamenChef

I've added support for parsing tile collision information; it still needs to be actually loaded into the collision engine.

TheRamenChef avatar May 19 '20 02:05 TheRamenChef