Chapter     8

Scrolling Multiple Backgrounds

In Chapter 7, solutions were presented for creating a background that could scroll. While that solution will help you create a compelling looking game, it could have more depth.

In this chapter, you will be presented with solutions for loading and using two images in your game’s background. Not only will this make your game more dynamic, it will allow you to scroll the two images at different speeds.

At the end of this chapter, a solution is presented for scrolling two different background images at different speeds. This gives a game a more realistic look and it adds depth to an otherwise flat environment.

8.1 Load Two Background Images

Problem

The background of the game needs to contain two images. ...

Get Android Game Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.