O'Reilly logo

Android Game Recipes: A Problem-Solution Approach by J. F. DiMarzio

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

Chapter     10

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

Problem

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.

Solution ...

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