|
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX
Advanced Lingo For Games
| |
| Game Variations
The biggest way that you can vary a trivia game is through the questions. They can represent one topic or many. They can be easy or difficult. That can even use humor to lighten up the game. Besides the questions, you can vary the mechanics of the game in several ways. Number of AnswersThis example movie uses four possible answers for each question. However, there is nothing in the code that specifies "four." You could just as easily use three. All you need to do is remove the fourth button and text member, and make sure that there were only three answers listed for each question in the database. Levels of PlayWhen a set of questions is finished, the "pEndGameFrame" doesn't necessarily have to take the user to a "Game Over" frame. It can instead take them to another set of questions. You can then create multiple levels, with each level getting harder and harder. With a little more coding, you could make the score cumulative instead of resetting after every frame. You can also count the number of correct answers on each level and only let the user move on to the next level if they get enough correct. Randomizing the QuestionsInstead of having a group of questions that get asked in the same order each time, you could have a large group of questions and have a random sampling of them asked. This would involve using the random function to choose a random question instead of using the "pQuestionNum" property. To make sure that a question is not asked twice, you could store the number of each question asked in a list, and then use getOne to check to see if the question has already been asked. It would look something like this: repeat while TRUE r = random(pDataMember.text.line.count) if not getOne(pAlreadyUsedList,r) then exit repeat end repeat add pAlreadyUsedList, r text = pDataMember.text.line[r] You must remember to initialize "pAlreadyUsedList" by setting it to [] in the on beginSprite handler. You also have to add it to the property declarations at the start of the behavior. If you look at the example on the CD-ROM, you will see that there is also a frame with this type of game on it. The behavior is called "Random Trivia Game Frame Behavior" and you can look at it to see the exact changes that were made to randomize the questions. If you turn off script coloring before loading the movie, the new lines show up in red. You can also use a similar technique to randomize the order of the answers. The Clock Is TickingOne simple improvement would be a looping "tick" sound on the game frame. This should make it sound like a clock is ticking and increase the feeling of urgency. | |