I've managed to read a file into my platform game made by the 'Tiled' level editor, using the TiledSharp library. I finally managed to get a level loaded and displaying properly in my game, but I can't work out how to access the custom properties I've set on tiles in the map. For example, I have a boolean property called 'Ignore' which specifies whether the tile should be ignored in collision calculations. I'd like to be able to read the 'Ignore' property of each tile as it's loaded. Something like this:
for (var i = 0; i < map.Layers[0].Tiles.Count; i++)
{
Console.WriteLine(map.Layers[0].Tiles[i].Ignore);
}
However I can't find a way of accessing those properties. Can anyone help please? Thanks!
Edit: Here's a little of the contents of the file I'm reading in:
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" renderorder="right-down" width="16" height="9" tilewidth="80" tileheight="80" nextobjectid="1">
<tileset firstgid="1" name="GroundTileSet" tilewidth="80" tileheight="80" tilecount="24" columns="6">
<image source="GroundTileSet2.png" trans="df7126" width="480" height="320"/>
<tile id="0">
<properties>
<property name="Ignore" type="bool" value="true"/>
<property name="OneWay" type="bool" value="false"/>
</properties>
</tile>