Game Development Reference
Once that's done, you can check whether or not an object exists in the game using this format:
This is the process used in Dungeon Maze Adventure to remove objects.
These are all very important technical details to keep in mind when designing your games.
This was a big chapter! There was a lot of code and many new concepts to absorb. Everything cov-
ered here, however, is absolutely essential to gaining a solid foundation in Flash game design. You'll
have to deal with all these issues sooner or later in your game design career. If you didn't understand
everything the first time, though, break the chapter down into smaller chunks and work through each
section carefully until it makes sense. Compare what you see happening while you play the game with
the code that makes it work. The best way to understand this chapter is to create your own version
of Dungeon Maze Adventure. You definitely have the skills to do it, and the steps you go through will
reinforce all the concepts covered here.
I hope this chapter got you thinking about how to start using classes to help build games. The model
you used here can take you quite far if you use it carefully. Just keep in mind the potential risks of
code dependency and try to avoid it wherever you can. In Chapter 10, you'll see how you can solve the
problem of dependency by having objects communicate by dispatching events.
Until then, have fun with some of the new techniques you looked at in this chapter. How about com-
ing up with a game that combines them with some of the other techniques you learned in earlier
chapters? For example, what about a dungeon or space game with huge scrolling levels? That would
be amazing! And how about incorporating some puzzle solving using input text, such as the number
guessing game from Chapter 5? Don't forget about random numbers—they can give your game a lot
of variety. Even at this stage in the topic, you have some real game-coding power at your fingertips.
The best way to learn is to dive in there and start making a game.
In the next chapter, you'll look at a completely different game genre: a platform game. You'll learn
how to make objects move using physics simulations and how to store and analyze data using arrays.
Have fun designing your next great game, and I'll meet you in Chapter 9 when you're done!