O'Reilly logo

Cocos2d-x Cookbook by Akihiro Matsuura

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

  1. Launch the Tiled application and reopen the desert.tmx file.
  2. Select the tree object in the Tilesets window.
  3. 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.
  4. After you name the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required