Game Development Reference
Here's how the game is played:
1. The player starts at the bottom-right corner of the stage and has to find its way up to the key in
the top-left chamber. A dragon is stalking the corridor; if the player touches it, the blue health
meter decreases. If the health meter falls to zero during the game, a screen is displayed with
the words Game Over, You Lost!
2. When the player touches the key, the player can carry it to the first door. If the player tries to
go through the door without the key, the player's movement is blocked. The door opens only
with the key, and the player can then move to the right side of the dungeon. When the door is
unlocked, a sound plays, and the key disappears.
3. The player's task is to find the star weapon, which can be picked up when it's touched. Pressing
the spacebar fires stars, and if the player manages to hit the dragons with five stars each, they
disappear from the stage.
4. When both dragons are vanquished, the second door at the top right of the stage opens, and
the player can move to the big red arrow. When the player touches the arrow, the screen dis-
plays the words Game Over, You Won!
Once you know the rules of a game, it's a reasonably straightforward job to translate them into code.
Setting up the game
Unlike many of the other projects in this topic, I won't walk you through the entire process of building
this one from scratch. This code represents a very specific solution to the very specific problems pre-
sented by the game, and every game you design will challenge you with its own set of problems that
you'll have to find creative solutions for. There's a lot of code, and you can find it all in the chapter's
source files if you need to take a closer look or modify it to test some of your own ideas.
What is of great importance, however, is that you understand how these problems are solved using
object-oriented programming techniques. Most of the details of how to solve these problems involve
code that you've seen before, but the context is quite different. Treat this case study as a tour of how
this game was made, but keep in mind how you can use these techniques to realize that game idea
that might be buzzing around in the back of your brain.
I'll cover a number of important technical issues that are crucial to be aware of to make fully devel-
oped games with Flash and AS3.0. You don't need to memorize any of them, but you do need to know
what the problems are and how to overcome them. There are some classic problems and solutions
related to Flash game design that I'll cover in the pages ahead, and you need to know them to take
your skills to the next level.
Here's how to make Dungeon Maze Adventure!