|
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX
Advanced Lingo For Games
| |
| 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. | |