O'Reilly logo

Android Game Programming For Dummies by Derek James

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 9

Creating an Animated Play Screen

In This Chapter

arrow Implementing simple animations

arrow Using sounds in your game

arrow Handling real-time interactivity

Understanding how to layer images to create the visual effects you want in your game, animate elements on the screen, handle real-time interactivity, and load and play sounds are all critical skills necessary to develop many types of games. This chapter will teach you the basic approach to all these skills and put you well on your way to developing your own game using these effects.

On to the meat of the Whack-a-Mole game!

Handling Images for the Play Screen

You actually want your players to be able to whack those onscreen moles. That’s the point of the game. To do that, you need moles to pop out of holes. Figure 9-1 shows what your mole image looks like.

Figure 9-1: Mole image.

9781118235997-fg0901.eps

Scary, isn’t he? The basic approach you take is to have three layers of graphics: the background, the moles, and masks that the mole images sit behind. To make more sense of this, look at Figure 9-2.

Figure 9-2: Play screen with mole and mask for Hole ...

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