Parsing object layers

The final topic we will cover in this chapter is loading objects from our Tiled map file. This is extremely useful and takes the guesswork out of placing objects within a level. Open up the Tiled application and we can create our first Object Layer by clicking Layer | Add Object Layer. This will create a new layer called Object Layer 1 as shown in the following screenshot:

Parsing object layers

We can create objects and assign any values and properties we want on these layers. First we will create a rectangle. Press R and click anywhere on your tile map, you will see a small square appear, as shown in the following screenshot:

Right-click on this ...

Get SDL Game Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.