Game Development Reference
In-Depth Information
//New Level
private var explodeArray:Array;
private var shotArray:Array;
private var shipArray:Array;
private var enemyArray:Array;
private var flakArray:Array;
private var bonusPlaneArray:Array;
private var crosshairs:Bitmap;
incomingCount holds a tally of the number of Enemy planes that have been created for the level.
We check incomingCount to know when the level is over.
private var incomingCount:int;
All of the following settings that need to be made available to the entire FlakCannon class, so we
need to define them as instance variables. These are the settings used to control the difficulty of
the games. Refer to Chapter 4 for detailed descriptions.
//Difficulty Knobs/Settings
private var enemyWaveDelay:int = 30;
private var numEnemies:int;
private var enemyFrameCounter:int = 0;
private var enemySpeed:int = 0;
private var enemyWaveMax:Number = 0
private var enemyWaveMultipleChance:Number = 0;
private var enemySideFloor:Number = 100;
private var enemySideChance:Number = 10;
private var bonusPlaneFrameCounter:Number = 0;
private var bonusPlaneDelay:Number = 1;
private var startShots:int = 30;
private var scoreNeededForExtraShip:int = 10000;
private var baseEnemyScore:int = 250;
private var enemyHitBonus:int = 500;
private var baseBonusPlaneScore:int = 500;
private var maxBonusPlanes:int = 1;
private var maxVisibleShips:int = 3;
private var bonusPlaneMaxY:int =350;
private var bonusPlaneSpeed:int = 3;
private var shipYPadding:int = 0;
The next set of variables contains temporary holders that we will define once and reuse in many
different functions. These will be use to hold an instance of our major objects ( Shot , Flak , Enemy ,
Ship , Explosion , BonusPlane ) when we iterate through the arrays designed to hold multiple
instances of them.
private var tempShot:Shot;
private var tempFlak:Flak;
private var tempEnemy:Enemy;
private var tempShip:Ship;
private var tempExplode:Explosion;
private var tempBonusPlane:BonusPlane;
After that, we include flakassets.swf for Flex versions of the game.
/*
//**Flex Framework Only
[Embed(source = "assets/flakassets.swf", symbol="CrosshairsGif")]
Search WWH ::




Custom Search