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 7 Section 5

Game Variations

There are many aspects of this game that can be varied. The whole metaphor for the game can be adjusted to suit a specific need. For instance, this game on my site is called "Meltdown" and is supposed to represent filling a nuclear reactor with fuel.

Changing the Shapes

The four shapes in the example movie are only suggestions. You could use the lists in the "on getPieceList" handler to make the shapes anything you want. Just remember to include all the rotation orientations.

Adding Color

You could make the blocks something a little different, like stars or circles. Or, you could keep them as blocks and just change their color. You could assign a random color to each sprite as it is assigned in the "on dropNewPiece" handler. The code could look something like this:


sprite(i).color = getAt([rgb("FF0000"), rgb("00FF00"), rgb("0000FF")],random(3))

Keeping Score

The only event in the game worthy of earning points is when a row is cleared. But you could also award points for every block that lands somewhere. You could keep track of this in a "pScore" property, and display it in a text member as shown in earlier chapters, like in the ÒGame VariationsÓ section of chapter 3, ÒMatching Game.Ó

Speeding It Up

The "pSpeed" property is set to 20 in the on beginSprite handler. You could easily change this value as the score increases. So, after a certain number of points, it goes to 19, which is a little faster. Then, it could go to 18, and so on.

Adding a Background

This game requires a vertical playing field. Because computer screens are wider than they are tall, and browser windows even more so, there is usually a lot of space to the left and right of the playing area. You can color this up with images, and even photographs. You could have the image change at different score milestones.