This chapter's game project is the Rock, Paper and Scissors game, which you probably remember playing when you were a small child. The rules of the game haven't changed. Each player attempts to outplay an opponent (in this case, the computer) by consistently selecting superior choices. The rules for scoring the game are listed below.
Rock crushes scissors to win.
Paper covers rock to win.
Scissors cuts paper to win.
Everything else is a tie.
Figures 9.1 to 9.5 show examples of the Rock, Paper and Scissors game in action, showing its functionality and overall execution flow.
Figure 9.1: The Rock, Paper and Scissors game beings by displaying the game board.
Figure 9.2: When the player clicks on the Play button, a 1.5-second countdown begins.
Figure 9.3: The player gets a half-second at the end of the countdown to make a selection by choosing Rock, Paper, or Scissors.
Figure 9.4: As soon as both the computer and the player have made their choices, the game displays graphics showing each move and determines who won.
Figure 9.5: The Rock, Paper and Scissors game also keeps a running tally of the number of wins, losses, and ties.