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 9 Section 4

Putting It All Together

To build this game you need at least five different graphics. First you need the graphics for the targets themselves. In the example on the CD-ROM, a duck silhouette is used. You can see this duck, along with an image of it after it has been hit, in figure 9.7.

Figure 9.7
The Cast window shows the target both before and after it has been hit.

Then, you need an image that represents the target after it has been hit. The example movie just uses the same duck graphic, but with a blast image placed over it.

The third item you need is the blast graphic. This graphic represents a shot that has hit the back of the screen or a non-target object.

The fourth graphic is an object that provides some cover for the targets. The example movie uses a simple rectangle, but you may want to use something better, such as boxes or trees.

The last graphic needed is the one-bit bitmap for the cursor.

After all the pieces are ready, and you have the four behaviors ready to go, you just need to do some assembly in the Score.

Start by dropping the frame behavior on the frame. Then, add the blast member to a sprite channel high in the Score, such as channel 50.

To add targets, do it one at a time. Drop a target member in the Score. Position it on the Stage approximately where you want it to go. Then, attach the sprite behavior to it. You'll have to fill in all the parameters to make the target move the way you want it to.

Before adding any more targets, first test this one. Run the movie and see how it moves. Stop the movie and make adjustments to the parameters and the sprite's position. Keep doing this until the sprite is moving exactly like you want it to.

Continue to add targets one by one. Test each one before moving on to the next.

After all your targets have been added, just add the non-target objects on higher-numbered sprite channels so that they cover the targets.

In some cases, the blocking objects will be in front of some targets, but behind others. This allows you to have some targets that appear in front of some objects. For instance, one duck can peak our from behind a tree, while another duck runs across the screen and in front of that same tree.

You need to remember to drop the blocking object behavior on the objects you add.