Game Development Reference
In-Depth Information
Defining the update function for ScoreTextField
The update function is called from the SuperClick.update function as it iterates through the
ScoreTextField instances in its scoreTexts array. The lifeCount value of the ScoreTextField is
incremented by 1 until it exceeds the life value. When it does, true is returned to the
SuperClick update function.
Defining the dispose function for ScoreTextField
The dispose function is called by SuperClick when the SuperClick.update function removes
ScoreTextField instance that have exceeded their life span.
Test it!
Make sure the all of the package classes are in the correct folders as described throughout this
chapter (this structure will depend on the development environment you have chosen). Select to
build the project, export the movie, or publish, or use the similar option in your development
environment.
The most common problem will be class path errors. If you are having problems with the build
process, start by rechecking the path to the framework package structure.
Summary
In this chapter, we finally created a full-blown game called Super Click using the framework
package structure. We created two new classes: Main.as class that is a subclass of the
GameFrameWork.as file and SuperClick.as that is a subclass of the Game.as class. We also
created two new game-specific classes for the Super Click game: Circle.as and
ScoreTextField.as .
In the next set of chapters, we will create an arcade blaster game called Flak Cannon and explore
many more game development concepts such as using BitmapData and pixel perfect collision
detection.
Search WWH ::




Custom Search