Chapter     7

Scrolling a Background

The solutions in this chapter will help you create a scrolling background for a game. Many game types have background images that scroll as the player is playing. Chances are you have some questions about just how to make the background image of your game appear to move.

In some cases, the images will scroll automatically. For example, scrolling shooters and other “rail”-style games will have backgrounds that scroll automatically. This is in contrast to other game types, such as side-scrolling platform games, where the background image will scroll in coordination with the movements of the player (this is covered in Chapter 8,“Scrolling Multiple Backgrounds”).

This chapter will present three solutions for ...

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.