Game Overview


Before getting into the rules of the game, let me introduce the equipment and some terminology.

The structure on which the game is played is called the table, or pool table. There are a total of ten balls on the table the cue ball and balls numbered 1 through 9. The cue ball is a completely white, blank ball. As in all pool games, a stick called the cue is used to strike the cue ball into other balls.

Before a game can begin, the table must be set up. You do this by racking the balls. The nine numbered balls are arranged in a diamond shape, with the 1 ball closest to the middle of the table and the 9 ball in the middle of the diamond. The racked balls (see the image below) are placed on one side of the table. That side is then called the foot of the table. The opposite side of the table is called the head. There are six notches marked on the sides across the length of the table. An imaginary line across the two second notches from the head of the table is called the head string. The four inner walls of the pool table are called cushions (or rails, or walls). There are six holes, called pockets, around the perimeter of the table.

graphics/18fig01.gif

Nine-ball is a two-player game. In real life, Player 1 is chosen by what is called lag (or lagging). Each player does the following:

  1. Place the cue ball somewhere behind the head string.

  2. Use the cue to hit the cue ball to the other end of the table, intending for the cue ball to rebound and to come to a rest as close to the head cushion as possible.

The person who gets the cue ball closest to the head cushion is Player 1. If you wish to enhance this Flash game, you can implement a similar selection process. However, in this version of 9-ball, I've set it up so that the challenger is Player 1.

I need to mention two more terms before discussing the rules: breaking and ball-in-hand. The act of hitting the cue ball into the rack is called breaking. Player 1 breaks by placing the cue ball anywhere behind the head string and then hitting it toward the rack. Ball-in-hand is when a player is allowed to manually place the cue ball anywhere on the table. On break, Player 1 gets ball-in-hand behind the head string. All other occurrences of ball-in-hand are not restricted to the head of the table.

Here are the rules of 9-ball:

  1. The game ends when the 9 ball is pocketed.

  2. If the player who sinks the 9 ball does so without losing his turn, then that player wins. Otherwise, the other player wins.

  3. When shooting, the cue ball must hit the lowest numbered ball on the table before hitting any other balls. It can hit the walls first.

  4. If the cue ball gets pocketed or if the lowest numbered ball is not the first ball hit not sunk then the player is said to have scratched. When a player scratches, he loses his turn and his opponent gets ball-in-hand.

  5. If a player sinks a ball without scratching, then that player keeps his turn and can shoot again.

  6. If a player fails to sink a ball, then that player loses his turn.

Those are the only rules! Some things should be inferred from the rules above. The goal of the game is not to sink all of the balls it is to sink the 9 ball without losing your turn. As long as you hit the lowest numbered ball on the table, no matter what ball goes in (except the cue ball), you keep your turn. So it is conceivable to win the game very early by hitting the 1 ball into the 9 ball and sinking the 9 ball. It is also possible and likely that one player can sink balls 1 8 and then lose his turn. Then the opponent sinks the 9 ball and wins the game.

One note about the rack: When the balls are racked, the 1 ball should be closest to the cue ball. When Player 1 breaks, he must hit the 1 ball or he will have scratched. It is possible, although unlikely, to either win or lose the game on the break.

graphics/cd_icon.gif

Now that you know the rules, let's walk through an example experience (from chat to game). Start ElectroServer on port 1024. Open the pool.fla file, found in the Chapter18 directory. This is the game file. If ElectroServer is running, you should be able to publish a SWF from the pool.fla file and enter the chat. For our example, open two instances of the published SWF and log in with two different names; let's say they are Frank and Estelle.

You can talk to your alter ego back and forth between. windows (which is good therapy sometimes).

graphics/18fig02.gif

In Frank's window, click Estelle's name in the user list. This will send her a challenge request. In Estelle's window, accept the challenge. Both players will be pulled into the game. Since Frank was the challenger, he is Player 1. So when he is pulled into the game, and when both people are verified to be in the game, then a message pops up in Frank's window, saying, "The game has begun. It is your turn." In Estelle's window the message reads, "The game has begun. It is your opponent's turn." Click OK in both windows.

Move to Frank's window. You should see that the cue ball is following your mouse around. You can place the cue ball anywhere on the table as long as it's behind the head string. You place the ball on the table by clicking the spot where you want it. Once the ball is placed, you can't pick it up and move it again. After you have clicked to place the cue ball, the cue appears. As you move your mouse, the cue rotates to follow. There is a faint line that acts as a guide for aiming the cue ball. When you find the direction in which you want to shoot, press and hold down the mouse button. Now you can move your mouse, and the stick will move toward or away from the cue ball. What you are doing is setting the amount of power at which you want to shoot the ball. On the top left of the table you can see a power meter. When you have adjusted the stick to the power you want, release the mouse button, and the cue ball will move in the direction you specified.

graphics/18fig03.gif

If Frank's shot first hits the 1 ball and then another ball sinks without scratching, then he gets to take another shot. Otherwise, it is Estelle's turn. Frank and Estelle take turns like this until one of them pockets the 9 ball. When the game is over, the pop-up message appears again, telling each player whether he or she has won or lost.



Macromedia Flash MX Game Design Demystified(c) The Official Guide to Creating Games with Flash
Macromedia Flash MX Game Design Demystified: The Official Guide to Creating Games with Flash -- First 1st Printing -- CD Included
ISBN: B003HP4RW2
EAN: N/A
Year: 2005
Pages: 163
Authors: Jobe Makar

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