|
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX
Advanced Lingo For Games
| |
| Game Overview
This game consists of a paddle at the bottom of the screen that the user can move back and forth. The purpose of the paddle is to hit a ball that moves in two dimensions. In addition, a group of bricks appear at the top of the screen that must be destroyed by the ball. The player uses the paddle to direct the bouncing ball and hit the bricks until all are destroyed. If the player misses the ball, it falls off the bottom of the screen and the player loses a life. Figure 12.1 shows the game in progress.
Figure 12.1
This Paddle Bricks game is in progress.
Moving the PaddleThe paddle's vertical position remains stationary, while the horizontal position matches that of the cursor. This is done by simply changing the locH property of the paddle's sprite. The BallThe ball must bounce off the sides and top of the screen. It should also bounce off the bricks. It would be easy to have the ball also bounce off the paddle. However, a true bounce would mean that the ball bounces off in exactly the opposite angle from which it hit. If we used this standard law of physics, then the paddle would be little more than a device used to prevent the ball from falling off the screen. Instead, we will change the angle of reflection according to where the ball hits the paddle. If the ball hits on the right side of the paddle, then the ball will fly up and to the right. If the ball hits the left side of the paddle, then the ball will fly off and to the left. The slope of the angle depends on how far from the center of the paddle the ball hits. So, if the ball hits in the center of the paddle, it will fly straight up. This allows the player to direct the movement of the ball. BricksThe only purpose of the bricks is to wait until the ball hits them. When it does, the brick disappears, the ball is reflected, and points are scored. When all bricks are gone, the level is over and the game should advance to a more difficult level. The look of the bricks can vary from brick to brick. You can use different members. In the example movie on the CD-ROM, a single 1-bit member is used, but the brick sprites have different colors applied to them to make the game more interesting. LevelsAs with "Space Rocks" and "Sprite Invaders," one level is represented by one frame. The ball behavior has a setting for speed that can be increased for every level. In addition, the bricks can take on a different layout for each level. You can place more bricks and make them worth different amounts of points. You can even place strange-looking bricks surrounded by normal bricks. The strange-looking ones can be worth a lot of points and play different sounds when hit. Special EffectsIn addition to being worth different amounts of points and using different members or colors, the bricks can also play different sounds when hit. You will probably not want to have a different sound for every brick, but rather assign points and sounds to groups of bricks. This method allows you to have a musical-sounding game. Each row of bricks, for instance, can play a different note when hit. Unusual bricks can play tunes or explosion sounds. | |