Game Development Reference
In-Depth Information
Chapter 2
Creating an AS3 Game Framework
In the previous chapter, we created a sufficient framework to start making a game. However, our
job here is not to be sufficient. You did not buy this topic because it was sufficient. If you wanted
sufficient, you would have purchased Sufficient Flash Games by Sufficiently Boring Textbook
Programmer and his brother. However, you did not. You bought The Essential Guide to Flash
Games because you wanted the goods . We will not let you down. This chapter takes the ideas
from Chapter 1 and starts to turn them into a reusable framework for making games. We will
iterate and reuse this framework for most of the rest of this topic.
The game framework is the foundation for making the second game. It is an expanded version of
the first chapter's framework with an emphasis on organization and reuse. Since this topic is also
not called Proper Object-Oriented Design Patterns and Principles for Games , you will see little
theory here and mostly practice. Many of these techniques have been hard won and developed
over many years of ActionScript programming. We have fought the wars through AS1, AS2, and
now AS3, so you don't have to do it yourself.
While our framework borrows from some design patterns, we feel that games are a very
expressive medium. We want you, the reader of this topic, to think outside that proverbial, over-
used box. While design pattern ideas lend them selves to all manner of application development,
we don't want you to feel hemmed in to using any one set of ideas for creating their games. Our
framework gives structure to the overall flow of a game but does not dictate how to code the
actual game logic.
Exploring the Framework
The game framework is housed in a reusable package structure. A package structure at its very
basic is an organized set of folders that will contain reusable classes. All of the standard class
files for using the framwork will be in this package structure. We will update and extend this
structure as we proceed through this topic. Let's start by giving you an idea of what classes we
will be creating for the framework.
Search WWH ::




Custom Search