Game Development Reference
In-Depth Information
The craft of making games in the AS3 game
framework
In this topic, we will create a game framework and then proceed to create a set of games that
use it. However, this framework is not a game engine . A game engine is more like a finished
piece of code that you would use as a black box to make a game; it's more about instantiation
and configuration than software engineering. An engine has functions that you use, so you don't
have to write the code yourself.
A game framework, on the other hand, is used to help you organize your code and game
functions. It can start out fairly simple but can be expanded and changed as your games get more
complicated. However, the basic pieces of the framework stay the same.
You can use engines with a game framework, but the framework itself is used as way to hang
everything else on. However, our framework does a bit more. It is going to make your games run
efficiently so they can really shine!
While we will be presenting our own game framework in this topic, you should only consider it a
starting point for your own work. Once you get good at making games, you will be able to
customize this framework to suit your own needs (or even make your own framework from
scratch). The purpose of this topic is not to evangelize our own framework, but instead, to give
you the tools and understanding to create your own games, at the same time illustrating that a
reusable framework can help you create that all important second game, third game, and so on.
Object-oriented methodology
Much of recent modern programming development involves both object-oriented. Since the game
framework is based on some these concepts, we will offer a short explanation them and why we
think they are necessary. While these concepts require a bit of preplanning to use them
effectively, they are also flexible enough that you can alter your design as you develop your game
and discover problems and features you did not consider when you started.
Object-oriented (OO) methodology is a software development concept that gives developers a
way to organize their software into logical parts that both act as their own entities and relate to
other objects through clearly defined interfaces. There are many features of OO design, but we
will mostly only use encapsulation and inheritance.
Encapsulation
Encapsulation is the idea you can break down your program into component parts ( objects ) that
in turn can contain properties ( variables ) and methods ( functions ) that can be concealed or
revealed to other objects. We will use this extensively within our game framework. Many game
framework services (e.g., the Sound Manager) will be updated throughout this topic, but because
they keep a common interface, newer versions will be compatible with games that were built with
older framework objects. Encapsulation makes this possible.
We will be using the concept of packages with encapsulation. A package is finite grouping of
classes that are used for a similar purpose. The game framework itself will be package, and each
game will have a package of its own. Classes in a package have the benefit of “knowing” about
the other classes in the same package, so they do not have to be explicitly imported.
Search WWH ::




Custom Search