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 16 Section 6

Game Variations

Again we have a situation where a game contains a list of words that can be used to suggest a theme. In addition to varying the theme of the words, you can make the matrix a different size, or even adjust the difficulty of the game in a variety of ways.

Word Themes

I won't even try to list suggested word themes for this game. The truth is that almost any theme can be used. You can do a list of words that are obviously related, such as the planets in my example movie, or you can make a list of words that vaguely suggest a theme.

Matrix Size

As mentioned during the "Making the Game" section, the matrix does not have to be 15[ts]15. A simpler game can be created with a smaller matrix, or a harder game with an even larger matrix. A larger matrix would also allow longer words.

To change the code to accommodate a matrix of a different size, you first need to change the "pMatrixSize" property in the on beginSprite handler. Then, if you want to resize the letters as well, change the font size and the fixedLineSpace property mentioned in the code. You should also examine the game to see if the selection line width still seems to correctly highlight the letters.

With a little trial and error, you can use this same code to present a word search game of any reasonable size.

Word Direction

Some people, myself included, find it nerve-racking to have to search for words in all eight possible directions. You can change the above code slightly so that words are only placed horizontally from left to right and vertically from top to bottom.

To do this, the piece of code in the "on buildMatrix" right after the "-- pick random direction" comment should be changed. Here is one way to do it.


-- pick random direction
    if random(2) = 1 then
      horizPlace = 1
      vertPlace = 0
    else
      horizPlace = 0
      vertPlace = 1
    end if

A clever programmer could even set it so that the letters can also appear diagonally, but only in the two diagonal directions that read from left to right.

Selection Methods

As mentioned earlier in the chapter, using a line shape sprite is not the only way to highlight a selection. You could use two lines, one on either side of the selection. Or, you could use a vector shape member to create an oval around the text.

You could also eliminate the need for a separate selection sprite altogether by just using different colors for the letters. Of course, this would mean keeping track of the previous colors of the selected letters so that they can be changed back to black or gray if a selection is not fruitful.