Game Development Reference
In-Depth Information
Importing the classes and defining the variables for
SuperClick.as
The class import and variable definition section sets up the class with the all needed framework
and Flash library classes needed as well as creates all of the necessary class level variables for
the game to run.
package com.efg.games.superclick
{
// Import necessary classes from the flash libraries
import flash.display.Sprite;
import flash.events.*;
import flash.text.TextField;
import flash.text.TextFormat;
import com.efg.framework.Game;
import com.efg.framework.CustomEventLevelScreenUpdate;
import com.efg.framework.CustomEventScoreBoardUpdate;
/**
* ...
* @author Jeff Fulton
*/
public class SuperClick extends com.efg.framework.Game {
//game logic and flow
private var score:int;
private var level:int;
private var percent:Number;
private var clicked:int;
private var gameOver:Boolean;
private var circles:Array;
private var tempCircle:Circle;
private var numCreated:int;
//messaging
private var scoreTexts:Array;
private var tempScoreText:ScoreTextField;
private var textFormat:TextFormat = new TextFormat(
"_sans", 12, "0xffffff", "true");
//game level difficulty
private var maxScore:int = 50;
private var numCircles:int;
private var circleGrowSpeed:Number;
private var circleMaxSize:Number
private var percentNeeded:Number;
private var maxCirclesOnscreen:int;
private var percentBadCircles:Number;
Search WWH ::




Custom Search