Note About This Book: Advanced Lingo For Games was written by Gary Rosenzweig in 2000 for users of Macromedia Director 7. It is presented here for free on an as-is basis, with no updating. Most of the information and code here can be used in the most recent version of Director. The book has been reproduced from the final editing files archived in 2000, and not the final proof galleys. So some minor differences between this version and the printed version my exist. The entire contents of this book are Copyright 2000, Gary Rosenzweig. No part may be reproduced or copied without written permission. The text here is provided for individual use only.
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX and we'll call it even!

Advanced Lingo For Games
by Gary Rosenzweig


Chapter 11 Section 5

Game Variations

This version of Space Rocks does not have all the bells and whistles of similar games. Adding these could considerably increase the amount of code. However, I would be remiss if I did not mention them.

Shields

The game already has a grace period built in for a short time after a new ship appears. You could also allow the user a limited number of shields that can be activated with a special key press. When the shield is up, the ship cannot be hit. You can use the same grace period code for this. For added effect, you may want to change the member that represents the ship to a bitmap that also shows the shield during this time.

Flying Saucers

You could have a flying saucer appear every once in a while that is worth extra points. A simple one could just behave like a rock, except that it only flies across the screen once. A more complex one can change direction, and even shoot bullets back at the player.

Thruster Graphics

You can have a second ship graphic member that represents the ship while the thrusters are being fired. This member is put in place of the ship while the user holds down then up arrow key.

More Rock Variations

The example game includes two variations of each size of rock. You can have just one variation, to keep the file size down. You can also have many more variations to enrich the game. Just make sure you name the new variations properly and change the code to reflect that it has more than two choices for each rock. You could even have the rocks change as the player moves up levels.

Using Vector Shapes

Instead of using bitmap shapes for the rocks, you can use vector shape members. There are two main advantages to this. The first is that they draw nicely no matter what angle the sprite is set to. The second is that you can accurately detect whether a bullet has hit one rather than using the distance formula estimate.

With a vector shape, you can use hitTest to determine if any point on the Stage is inside the boundaries of the vector shape.