Game Development Reference
In-Depth Information
In Figure 10-5 , notice that the Game Over overlay doesn't completely hide the other objects and
the background. The reason is that the Game Over sprite has some transparent pixels. Often,
sprites have transparent parts so the sprites seem to be integrated parts of the game world. The
balloon, the ball, the paint cans, and the cannon barrel all are partly transparent, which is why they
seamlessly integrate into the game world. When designing sprites, you need to make sure the image
has these transparency values set correctly. Although doing this right can be a lot of work, modern
image-editing tools such as Adobe Photoshop give you many means to define transparency in
images. Just be sure you save the image in a format that supports transparency, such as PNG.
Note You can use the (lack of) transparency of overlays to control what the player is seeing. In some cases,
you might want things obscured (such as a “pause” screen in a time-sensitive game) or able to be seen
(such as the Game Over screen in Painter).
What You Have Learned
In this chapter, you have learned:
How to store and display the number of lives a player currently has
How to repeat a group of instructions using the
while or for instruction
How to restart the game when the player has no lives remaining
 
Search WWH ::




Custom Search