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 4

Putting It All Together

Like with Sprite Invaders, this game requires one frame for every level. Place the frame behavior on the frame, and then start adding the sprites.

In the example movie on the CD-ROM, sprites 5 through 9 are used as the bullet sprites. Then, sprites 11 through 42 are used as the rock sprites. This allows for a maximum of 32 rocks on the screen at one time. Because each big rock can eventually give birth to four small rocks, 32 sprites can handle an initial value of 8 big rocks.

Sprite 44 is used as the ship sprite. It is placed in a higher-numbered channel so that it appears above any rocks or bullets on the screen.

The "score" text member is placed in sprite 3, which places it underneath passing rocks, bullets, and the ship.

After several levels have been laid out, the first level is set to have a "pStartingLives" value of 3. The rest of the frames have this set to 0, so that the number of lives and the score are not reset.

Each frame has "next" as the frame for the next level, but the "End Game" frame for the game over frame.

Instead of having the levels go immediately from one to the next, you may want to have an intermediate "get ready for the next level" frame in between. This also allows you to loop and repeat the last level over and over again instead of just ending the game after three levels.