Game Development Reference
In-Depth Information
The Flex SDK package structure
The Flex SDK package structure is very similar to the Flash IDE package structure with one small
difference. Flash Develop and other Flex tools use a specific set of folders for organizing their
own project structures. To accommodate these and still have a common package structure for
our games, we must add the Flash Develop created src folder to the flexSDK folder. You will not
have to create the src folder or the package structure by hand, as Flash Develop will create it
automatically for you when you start a new project. In the section called “Setting up the game in
Flash Develop,” we will go into the details. For now, here is the way the structure will be laid out
(including the Flash Develop specific folders such as bin , obj , and lib . If you have used Flash
Develop to create a Flex SDK project, you will recognize the following structure:
[projects]
[stubgame]
[flexSDK]
[bin]
[obj]
[lib]
[src]
[com]
[efg]
[games]
[stubgame]
Notice that we have created the exact same package structure inside the src folder as we will
use with the Flash IDE. The package name for our game will be com.efg.games.stubgame .
The package name in the code for classes in both the Flash IDE and Flex SDK will be the same:
package com.efg.games.stubgame
{
The Main.as and StubGame.as files
When we start to add files to the subgame package we will be creating two subclasses (or
children) of framework classes that will be unique to our game. The Main.as will be created as a
subclass (or child) of GameFrameWork.as framework class. The StubGame.as class will be a
subclass (or child) of the Game.as framework class.
Starting a project using the framework packages
You have just seen the basic package structure for both the framework reusable classes and the
projects we are going to create. Let's make use of this right away by creating a project for the
stub game. The stub game will be very similar to the Chapter 1 game where the player is tasked
with clicking the mouse ten times.
Creating the stub game project in the Flash IDE
Follow these steps to set up stub game using the Flash IDE:
1.
Start up your version of Flash. I am using CS3, but this will work exactly the same in
CS4 and CS5.
Search WWH ::




Custom Search