18
GAME STATE, MENUS, SOUNDS, AND SPECIAL EFFECTS
In this chapter, we’ll add the concept of state to Schoolhouse Skateboarder. The state of a game is what mode the game is in, such as whether the game is running or has ended and is waiting to start again. Up until this point, the game was always running, and it immediately started over when it ended. Keeping track of the game’s state will allow us to add a simple menu system to show when the game is over. We’ll also add some sounds to the game and create some special effects using a particle emitter.
TRACKING GAME STATE
First we’ll create an enum that lists the various states the game can be in. ...
Get Coding iPhone Apps for Kids, 1st Edition 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.