On 5/16/13, JR Padfield <
crzyo...@gmail.com> wrote:
> I'm working on intergrating Tiled maps using xTiled in my ORPG engine. I
> was using a different/home made map editor but it was taking to long to get
> it finished so i transfered to Tiled. So here is my logic from server side
> to check for tile type.
>
> // CHECK TILE TYPE //
>> if (Types.Map[mapNum].Tile[X, Y].Type !=
>>> Constant.TILE_TYPE_WALKABLE)
>> {
>> if (Types.Map[mapNum].Tile[X, Y].Type !=
>>> Constant.TILE_TYPE_NPCSPAWN)
>> {
>> if (Types.Map[mapNum].Tile[X, Y].Type !=
>>> Constant.TILE_TYPE_ITEM)
>> {
>> return false;
>> }
>> }
>> }
>>
> Is there a way to load information from Tiled tiles?
I assume xTiled will allow you to access the tile properties you
associate with tiles in Tiled. Until Tiled 0.9.0, you can edit each
tile's properties by right-clicking a tile and selecting "Tile
Properties...". If you use a daily build you select a tile and open
the Properties dock where you can edit the tile's properties.
In either case, you can add a "Type" property and give it some value.
For readability's sake you'd usually use a string like "NPC",
"Walkable" or "Item".
If you're going to check a tile's type against three other values, you
may want to store it in a local variable first, btw. :-)
Best regards,
Bjørn