|
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX
Advanced Lingo For Games
| |
| Making Games
Each time I create a game I use a slightly different process. However, I often get asked how it is done. So, I will suggest a method of creating games, but this is by no means that only way to go about it. I use a variety of factors to determine how I will create a game. I take into account the type of game, its complexity, and the amount of time I have to create it. Sometimes I choose one method over another simply because I feel like a change of pace, or I wish to experiment with different styles of programming. Game ScreensIt is sometimes useful to have a checklist of things that need to be done to make a product. Games vary greatly in what they include, but there are some elements of games that keep reappearing. Think of these elements before planning your game. All of them are optional, however.
Figure 1.2
The introduction screen to "The Peanut Butter and Jelly Wars" game. This game is just a simple Reversi game. However, the introduction screen proposes a metaphor to the player.
Figure 1.3
Here is an example of an instruction screen. This one uses a little humor, based on the fact that objects in arcade games don't always have real names, to lighten up the game a bit.
Figure 1.4
Here is an example of a game background screen. The industrial theme of "Meltdown" turns a simple puzzle game into a deeper experience.
Figure 1.5
This example of a "between levels screen" is from my game Rapid Fire.
Figure 1.6
The "end game" screen for my game Bomb Squad. This also allows the player to submit a high score to the Internet.
Figure 1.7
The "high score display" screen for my game Aztec Underworld.
Planning and PreparationThe first step in developing any game is to come up with an idea. Sometimes this is a totally new idea. But, more often, the idea has some roots in a previously made game. Maybe you are out to remake an arcade classic. Or, maybe you want to translate a non-computer game. Either way, you want to define the game as well as you can. What elements are involved? What are the rules by which the elements move or change? What is the goal of the game? For instance, in a game like Asteroids, you would determine that the game elements are a spaceship, some asteroids, and a flying saucer. The rules are that the ship can rotate, thrust and fire shots. The asteroids move around and break apart when they are hit. The flying saucer moves around, fires shots, and explodes when hit. The goal is simply to get a good score. These are the basic rules of an Asteroids game. Of course, there are more details to be worked out, which you work out if you were actually planning to make the game. The next step is to determine how the user will interact with the game. A key choice is whether to use the mouse, keyboard, or both. Then you need to determine what the mouse button, mouse movement, or certain keys will do. After this, you can begin to plan out your Cast and Lingo code. What sort of behaviors will you use? How many cast members are needed? How will all the elements interact. There are usually many answers to these questions. You can't necessarily determine that one way is right and another wrong. Ten Lingo programmers will probably create a certain game ten different ways. It's important that you think about your method, however. Try to make a plan. Make a list of which cast members you will need and which scripts you will need to create. All this planning, however, can't predict the problems that might arise while creating the game. Be prepared to make changes as you go. Where to StartNow that all your planning is done, it's time to get down to programming. Just as with planning, there is no one right way to go about doing it. Here are some suggestions, however. You could start by gathering all your media together. You make, or get someone else to make, the bitmaps, sounds, and other elements. Then, you gather all this together in the Cast before doing any programming. You could also jump right into the programming, and fill the media elements in as you go along. This works especially well if the programmer and artist or sound designer is a different person. Then you are all working in parallel. You could also try to experiment with Lingo to see how you are going to accomplish your hardest tasks. I use this technique a lot. I determine which part of the game will be the most difficult, and I start writing the behaviors to handle it. I usually experiment with different methods to see which is faster, or seems more elegant. Finishing the GameDuring game development, some of the minor details are usually left out until the end. These are things like scoring, levels, high score boards, payoffs, congratulatory messages to the player, sound effects, background images, introduction screens, and instructions. Oddly enough, these are often the most important elements of the game to the player. I have seen many Director-based games that have shown promise, but have suffered because the programmer simply did not finish the game by adding one or more of these elements. After you get the game mechanics working, and you find that you can finally play your own game, remember to add these seemingly little touches. They can make the difference between a good game and a bad one. Troubleshooting and DebuggingAt the beginning of this chapter, I wrote about taking programming tasks on one step at a time. You need to apply the same principle to debugging your game. Every programmer has to debug. Writing anything other than the shortest program will result in some issues arising before the program works perfectly. When someone is trying to fix a bug in his program, I usually get asked: "What is wrong?" The only appropriate reply is "You tell me." This is because no one is in a better position to fix a bug than the original programmer. You know the code because you wrote it. You probably have it right in front of you. The best way to kill the bug is to simply start investigating. If your problem is a Director error message, use the Debug button in the error message dialog box to check out the values of the variables at this point in the program. You will often be able to spot which variable is not what it should be. Then chase the variable backward through your code to see what went wrong. What most beginner programmers do not realize is that debugging is a slow process that cannot be avoided. Most of the calls for help that I get through email are simply cases of a beginner that sees trouble and panics. Don't panic, just take your time and debug. User TestingBugs are not always as obvious as error messages or unexpected behavior. Sometimes, a game can work exactly as the programmer intended, but still have a bug in it. This is because the game has not yet been tested by its audience. Only they can find bugs like usability problems and game inconsistencies. These need to be fixed just as much as error messages. How you test and how much you test is up to you. Both extremes are bad: not testing enough so that the game is released with problems, or testing so much that the game never gets released at all. You have to choose your method of testing and implement it. Here are some common techniques that I have used: DistributionAfter the game is complete, you need to get it to the people who want to play it. Rejoice in the fact that Director gives you more distribution options than the game engines used by the largest development companies. Director movies are already cross-platform, which, in this case, means that they can be played on both Mac and Windows computers. If you are making a standalone application, called a Projector, you need to make a Mac Projector and a Windows Projector. Projectors allow you to deliver games on CD-ROM or other hard media. You could also deliver a Projector over the Internet as a download. If you are creating a game for Web delivery, your compressed Shockwave file will work on players with either type of computer. Shockwave delivery is an extremely powerful feature of Director. You can't exactly make Quake III with Director, but you can reach millions of people over the Internet with almost no distribution cost. Shockwave works with both Netscape Navigator and Microsoft Internet Explorer. It even works with other browsers that support the Netscape plug-in architecture. In addition to the Projector and Shockwave delivery, there are also some variations. Director 7 and 8 allow you to make Shockwave projectors. These are small Projectors that use the Shockwave engine installed on the user's computer. If they do not have Shockwave installed, it allows the user to install it. The best part about distributing your Director-based game is that you don't have to decide the format at all. You can create the game even if your distribution method has not yet been decided. Before putting these techniques into practice, take a look at Chapter 2, "An Introduction to Games," to review the history of gaming and computer games, and see where Director fits in. | |