Getting the property of the object in the tiled map
Now, you can move the Tiled map. However, you might notice the object on the map. For example, if there is a wood or wall in the direction of movement, you can't move in that direction beyond that object. In this recipe, you will notice the object on the map by getting the property of it.
Getting ready
In this recipe, you will make a new property of the tree object and set a value to it.
Launch the Tiled application and reopen the
desert.tmx
file.Select the tree object in the Tilesets window.
Add a new property by clicking on the plus icon in the lower left corner in the Properties window. Then, a window will pop up specifying the property's name. Enter
isTree
in the text area.After you name the new property, it will be shown in the properties list. However, you will find that its value is empty. So, you have to set the new value to it. In this case, you need to set a true value as shown in the following image:
Save it and update
desert.tmx
...