Game Development Reference
In-Depth Information
6.
Change the size of the output and frame rate by selecting the Project Properties
Classpaths menu item. Set the Frame Rate to 40, the width to 600, and the height to 400.
Here is the folder structure for the Flex SDK version (made with Flash Develop).
[source]
[projects]
[blastermines]
[flexSDK]
[bin]
[obj]
[lib]
[src]
[com]
[efg]
[games]
[blastermines]
We now have the basic structure to start creating projects inside the framework, so we are going
to discuss a few topics concerning the structure of the framework classes and then move into
building the reusable framework code.
For Flex Builder, Flash Builder, or another IDE, please refer to the documentation provided for
that product to create a new project and set the default compile class.
As mentioned previously, a common method of Flash development is to use the Flash IDE for
assets and organization and Flash Develop for code editing. If this is your workflow of choice,
you will want to follow the Flash IDE folder and package structure rather than the Flex SDK
folder structure.
Creating the Main.as class for Blaster Mines
As with each game covered so far we must create a unique Main.as class for Blaster Mines. It will
be based on the Main.as from Chapter 10, but there are many changes specific to Blaster Mines
and many changes specific to the game framework.
Let's create this class as the next new file for the Blaster Mines game package. Here is the class
file name and location for the Flash IDE:
/source/projects/blastermines/flashIDE/com/efg/games/blastermines/Main.as
And this is for the Flex SDK (using Flash Develop):
/source/projects/blastermines/flexSDK/src/com/efg/games/blastermines/Main.as
Here is the entire Main.as class. Well look at the changes after you have taken a look at all of the
code for the class:
package com.efg.games.blastermines
{
import com.efg.framework.FrameCounter;
import com.efg.framework.FrameRateProfiler;
import com.efg.framework.GameFrameWorkAdvancedTimer;
import flash.text.TextFormat;
Search WWH ::




Custom Search