Game Development Reference
In-Depth Information
The ScoreBoard elements that we will create for Flak Cannon, while different than previous
games, operate the same. Here, we create some static const values that we will use the
reference these elements inside our game.
public static const SCORE_BOARD_SCORE:String = "score";
public static const SCORE_BOARD_SHOTS:String = "shots";
public static const SCORE_BOARD_SHIPS:String = "ships";
One of the significant additions to Main.as for Flak Cannon is support for playing sounds. We
need to create a static const that we will reference inside the FlakCannon class when we want to
play a sound. We need to create one static const for each sound. Also, if you are using Flex, you
will need to embed each sound individually.
//custom sounds
public static const SOUND_BONUS:String = "sound bonus";
public static const SOUND_BONUS_SHIP:String = "sound bonus ship";
public static const SOUND_SHOOT:String = "sound shoot";
public static const SOUND_NOSHOTS:String = "sound no shots";
public static const SOUND_EXPLODE_PLANE:String = "sound explode plane";
public static const SOUND_EXPLODE_FLAK:String = "sound explode flak";
public static const SOUND_EXPLODE_SHIP:String = "sound explode ship";
//**Flex Framework Only
/*
[Embed(source = "assets/flakassets.swf", symbol="SoundExplodePlane")]
private var SoundExplodePlane:Class;
[Embed(source = "assets/flakassets.swf", symbol="SoundExplodeFlak")]
private var SoundExplodeFlak:Class;
[Embed(source = "assets/flakassets.swf", symbol="SoundShoot")]
private var SoundShoot:Class;
[Embed(source = "assets/flakassets.swf", symbol="SoundNoShots")]
private var SoundNoShots:Class;
[Embed(source = "assets/flakassets.swf", symbol="SoundBonus")]
private var SoundBonus:Class;
[Embed(source = "assets/flakassets.swf", symbol="SoundBonusShip")]
private var SoundBonusShip:Class;
[Embed(source = "assets/flakassets.swf", symbol="SoundExplodeShip")]
private var SoundExplodeShip:Class;
*/
public function Main() {
init();
}
Search WWH ::




Custom Search