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

Games and Macromedia Director

At its root, Director is an animation and presentation tool. However, it has evolved over the years into a complete programming environment.

Like any such environment, developers want to use it to make games. And Director is very accommodating to that purpose.

However, Director gets no respect in the game development industry. I think this actually comes out of the early success of Director. A lot of people bought and used Director versions prior to version 4. Many of the people in the game development industry still think of Director as the same, simpler tool that it was in version 3, and not the complex development environment that Director 8 is today.

Director is capable of quite a lot, but it has the reputation of being a slow, limited, presentation tool. It is still categorized with PowerPoint and HyperCard, rather than with C++ and Java where it should be.

However, thousands of games have been created with Director. Some are as simple as matching games, and others are complex role playing or strategy games.

Director's Strengths

Lets look at Director's strengths and weaknesses as they apply to game creation. Lets start with Director's strengths:

  • Rapid Development--Nothing I have seen beats Director here. I am amazed when I hear about 2-, 3-, or 4-year development times for games. Then, they still don't work until the company releases the second patch. Director allows you to create simple games in days rather than weeks, and complex games in months rather than years.
  • Multimedia--Adding images, sounds, and even video in Director is an easy task. Most of the work has already been done for you by the Director engineers. You just need to drag and drop. The quality is also as high as you want: CD-quality sound and 32-bit color.
  • Lingo--Lingo is a powerful programming environment. You can play sounds and move graphics with single lines of code. At the same time you can construct complex data structures and perform tricky math. No complex libraries "includes" like with C++ and Java.
  • Delivery--Director gives you a lot of options when the game is done. Imagine what other companies need to do to take a Windows game and port it to the Mac. You just need to open the file and create a new Projector.

    Director's Weaknesses

    Now, let's look at Director's weaknesses as a game development tool:

  • 3D Graphics--You can create 3D graphics and place them in Director movies and you can simulate simple 3D graphics with mathematical algorithms applied to sprites. But, if you are looking for Quake III quality, you are out of luck. The only 3D Xtras available are slow and/or expensive.
  • Closed Programming Environment--Suppose you create a game that uses something that no one has tried before in Director. Then, you find out that there is a limitation in Director that causes your game to not work because of this unique feature. If this was a custom environment like the big game companies use, you could simply fix it. However, with Director, the best you could do is submit a bug report to Macromedia and wait for the next version of Director to come out. This is a disadvantage of any closed environment.
  • Limited Feature Set--Director has a huge feature set, enormous compared to its multimedia tool competitors. However, if you use your own engine you can add features by doing system-level programming. You can do this in Director to some extent by adding Xtras, but it cannot be done using Lingo. Xtras, which are compiled plug-ins that add functionality to Director. Because you need to create them in a C++ or similar environment, they are difficult to add, but they can be very powerful in some cases.
  • Speed--Director 7 and 8 are very fast compared to previous versions. However, speed will always be a problem because Lingo is an interpreted language and there is no way to match the C++ or even assembly code that big game development companies use.

    Even these limitations have their advantages. The speed issue is counterbalanced by the fact that Lingo is much easier to program in than C++ or Java. The closed environment and limited feature set are offset by the fact that Macromedia does all the work on the engine, and you get it all for less than $1,000 instead of the cost of your own engineering team.

    All said, Director is a great environment for creating games. If you don't already believe it, this book should prove it to you.