Game Development Reference
In-Depth Information
ScoreTextField instances will contain data for the life span they will stay on the screen
before being removed.
Creating Super Click
We are now going to take the game design specification and apply it to the game framework from
Chapter 2 to create our game. We will start by creating a new Game.as class.
The Super Click game requires you to create a new Game.as file for the Game class and a new
Circle.as file for the Circle class.
Starting the project
Like in the stub game in Chapter 2, we will be creating Super Click as part of the overall
framework package structure. In this chapter, we will discuss how to add a new game to the
existing framework and package structure. Please refer to Chapter 2's detailed discussion on the
framework and package structure if you have not done so previously.
Creating the Super Click game project in the Flash IDE
Here are the steps to create this project in the Flash IDE:
1.
Start up your version of Flash. I am using CS3, but this process should work exactly
the same in CS4 and CS5.
2.
Create a .fla file in the [source][projects][superclick][flashIDE] folder called
superclick .
3.
In the [source]projects][superclick][flashIDE] folder, create the package structure
for your game: [com][efg][games][superclick] .
4.
Set the frame rate of the Flash movie to 30 FPS. Set the width and height both to 400.
5.
Set the document class to com.efg.games.superclick.Main
6.
We have not yet created the Main.as class so you will see a warning. We are going to
create this later in this chapter.
7.
Now, add the framework reusable class package to the class path for the .fla file. In
the Publish Settings, select Flash Actionscript 3 Setting.
8.
Click the Browse to Path button, and find the /source folder we created in Chapter 2 for
the package structure.
9.
Select the classes folder and click the Choose button. Now the com.efg.framework
package will be available for use when we begin to create our game.
Search WWH ::




Custom Search