Game Development Reference
In-Depth Information
The most important rule for designing isometric maps is that you need at least two lay-
ers so that game characters can walk behind certain tiles. One layer is for flat ground
objects and floor tiles, and the other is for all other objects that either overlap other tiles
or are not fully opaque, such as items. In the tileset of Figure 11-6 , the first two rows
are ground tiles and need to be placed on the ground floor, whereas in row 3 the moun-
tains as well as almost all tiles in row 4 and after need to be placed on the Objects lay-
er.
In Tiled, add two new layers via Layer Add Tile Layer … and name them Ground
and Objects. Make sure the Objects layer is drawn on top of the Ground layer. When
designing your tilemap, you should take great care to lay down only fully opaque, flat
floor tiles on the Ground layer. All other tiles have to be placed on the Objects layer.
Cocos2d has issues with properly displaying game characters and other sprites behind
partially occluding tiles in tilemaps, unless you apply the following steps. As one part
of the solution, you need to add a special property named cc_vertexz to tiled lay-
ers. I explain the solution in more detail shortly; for now, select the Ground layer and
click Layer Layer Properties. … Add a new property named cc_vertexz and set
its value to −1000. Do the same with the Objects layer but instead of entering −1000,
enter the string automatic , as in Figure 11-10 .
Figure 11-10 . The Objects layer needs the cc_vertexz property set to automatic
Now you can spend some time designing a nice-looking tilemap, or you can simply
load the one I designed in the IsoTilemap01 project. Be sure to put only floor tiles on
 
 
Search Nedrilad ::




Custom Search