The Soccer Game

The final project for this chapter is a simple game of soccer, as shown in Figure 8.1. The user is in control of a simplified team of five players: a goalie, fullback, halfback, wing, and center. At any time, only one of these players can have control of the ball. The user can click a player to attempt a pass to that player or can take a shot on the goal. The likelihood of a pass's being successful depends on which player has the ball and to whom he is kicking. For example, the goalie will more likely pass successfully to the fullback than to the center, who is usually lurking all the way down the field, because it’s almost impossible for the goalie to successfully shoot on the opposing goal. If the user is unsuccessful in a pass or shot attempt, the opposing team gets the ball and earns the chance to score. The game plays for one minute.

Figure 8.1. The player within the square outline has the ball. He can either pass to another player or make a shot on the goal.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.79.176