Building a Level Using Tiles
In this chapter, you will be presented with two solutions for building a level out of tiles. Many 2D games (specifically, side-scrolling platform and top-down adventure/RTS-style games), implement levels that are built with repeatable tiles.
If you have had trouble building levels from tiles, this chapter should help. The first recipe will look at loading up the tiles from a sprite sheet and creating a level map. The second recipe will use the sprite sheet and the level map to then create a full level from the tiles.
10.1 Load Tiles from a Sprite Sheet
The tiles used to create a level are stored in a sprite sheet, and there is no way to determine which tile to use in which position.