PROJECT PREVIEW: THE CLICK RACE GAME


The game project that you learn to develop in this chapter is called the Click Race game. The object of this simple game is for the player to see how many clicks he can score in 30 seconds. Two buttons are provided, but because simply clicking is a bit easy, the game challenges the player by forcing him to alternate between the two buttons. To play well, the player must be able to quickly switch between buttons and click each accurately.

The Click Race game starts up as shown in Figure 2.1. The game buttons that the user must click to score points are located at the bottom of the game window. At the start of the game, these buttons are disabled (grayed out).

image from book
Figure 2.1: Starting up the Click Race game.

The game begins when the player selects the Start Game button. When this happens, the game button on the left side of the window is enabled, as demonstrated in Figure 2.2.

image from book
Figure 2.2: Players score points by clicking on the currently active game button.

The player scores a point by clicking on the button. After the button is clicked, the left game button is disabled and the right game button is enabled, as demonstrated in Figure 2.3.

image from book
Figure 2.3: To score another point, the player must click on the second game button.

The Click Race game allows the player to score as many points as possible within a 30-second period. Gameplay stops at 30 seconds when both game buttons are disabled. The total number of points scored by the player is displayed, as demonstrated in Figure 2.4.

image from book
Figure 2.4: Plays ends at 30 seconds when both game buttons are disabled.

After you have successfully created the Click Race game, you'll have learned how to build a program that dynamically responds to events that the player generates. You'll also have learned how to work with the Visual C++ Timer control.




Microsoft Visual C++ 2005 Express Edition Programming for the Absolute Beginner 2006
Microsoft Visual C++ 2005 Express Edition Programming for the Absolute Beginner 2006
ISBN: 735615381
EAN: N/A
Year: 2005
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net