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     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. ...

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