|
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX
Advanced Lingo For Games
| |
| Game Overview
The idea of a Hangman game seems simple, but that's not the case when you start to think of all the elements required. You can see each of these elements in the screen shown in Figure 15.1.
Figure 15.1
The Hangman game screen is shown here, just after a player has lost.
The WorkspaceFirst, you need a text sprite that displays the phrase as it is being solved by the user. This text starts off as all underscore characters. Each underscore is replaced by a letter as the game progresses. This text member is called the "workspace." We will have a property in the game behavior that represents the workspace. In addition, we will place this text into a text member on the Stage for display. Guessing LettersSecond, you need a way for the player to guess letters. You can use the keyboard for this, but because we cannot remove letters from the keyboard as the player guesses, it's better to have a visual element instead. This will be a list of the 26 letters of the alphabet. The player will be able to click on any letter. As they make guesses, the letters disappear from the list. So the list acts both as a set of buttons for the player to click, and as a reminder of what letters the player has yet to choose. The HangmanNext, you need the hangman graphic. The graphic starts as a simple line, representing the platform, but builds up to a full picture of a person swinging from the gallows. Figure 15.2 shows a sample set of bitmaps.
Figure 15.2
This set of bitmap members shows the Hangman at each stage.
The Hangman is actually a series of eight bitmap images. The first is image zero, which represents just the platform as is shown at the beginning of the game. The other images add a bit of the picture until image number seven, which shows the full, gruesome, picture. We will name these in a standard fashion to allow the behavior to be able to figure out which image is needed at any given time. The Message AreaIn this game you need to have a message area to pass along some information to the player. For instance, we want the game to be able to present more than one phrase. This means that the player's chance to solve one phrase will end at some point, but the game will not yet be over. There is the situation where the Hangman is fully drawn, and the player has not yet guessed the phrase. In this case, the message "Game Over. Try Another." appears. At this point, the player cannot choose another letter. The same situation arises when the player guesses all letters in the phrase. The player is not allowed to choose another letter at this point. The message area relays to the user that they need to take an action other than guessing more letters. Next Phrase ButtonWhen the game is frozen because the player has figured out the phrase or the Hangman is complete, the player needs to be able to move on to the next phrase. For this purpose, there will be a "Next Phrase" button on the Stage. This button can also be used by the player to abort any single phrase and move on early. PhrasesJust as the cryptogram game (see Chapter 14, "Cryptogram") took its phrases from a pool of phrases in a text member, so will this game. Another similarity is that the phrases will be converted to all uppercase letters. Special EffectsSounds will really help this game to move along. We will use sounds for each of the two possible outcomes of a game sequence. We will also use a positive sound for when a player guesses a useful letter, and a negative sound for when a letter is guessed that draws more of the hangman. | |