Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 19. Adding Polish to Your Game > Enhancing the Ball-Dropping Experience

Enhancing the Ball-Dropping Experience

At this point, the initial requirements for the game have been met. The game is displaying and animating a ball, allowing it to be controlled through accelerometer input and detecting collisions with the sides of the screen, the game goal, and game hazards. The game is, however, still very rough. With some additional enhancements, you could have a game that provides a much richer gaming experience.


Try It Yourself: Working with a BallDropping State

As you play the game, you might have noticed that as soon as the ball collides with the goal, the game is abruptly paused and the user is shown his or her current game points and prompted to tap the screen to continue. A better experience would be to give the appearance of the ball falling to the middle of the hole. To do this, an additional state needs to be added to the GameState enumeration to represent the transition between Active and BallDropped. This state is the BallDropping state. By completing the following steps, you will implement the code necessary to work with this new state. If you closed Visual Studio, repeat the previous exercise first. Also, be sure to keep Visual Studio open at the end of this exercise because you will use this application later.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint