The new and improved map

For as good as the second project of this book looked, a lot of things about it were fairly primitive. Among its other shortcomings, the map design lacked complexity due to its inability to support tile layers. Having a more complex scene requires tiles being able to layer over each other, in a manner best represented by this illustration:

The new and improved map

Adding layer support, as well as loading entity information after re-designing the way entities are handled requires some changes to be made to the map file format. Let's take a look at an example:

SIZE 32 32 DEFAULT_FRICTION 1.0 1.0 |ENTITY|Name|x|y|elevation| ENTITY Player 256.0 256.0 ...

Get SFML Game Development By Example now with O’Reilly online learning.

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