Game Development Reference
In-Depth Information
package com.efg.games.notanks
{
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import flash.geom.Point;
import com.efg.framework.FrameWorkStates;
import com.efg.framework.GameFrameWork;
import com.efg.framework.BasicScreen;
import com.efg.framework.ScoreBoard;
import com.efg.framework.SideBySideScoreElement;
import com.efg.framework.SoundManager;
public class Main extends GameFrameWork {
//custom sccore board elements
public static const SCORE_BOARD_SCORE:String = "score";
public static const SCORE_BOARD_AMMO:String = "ammo";
public static const SCORE_BOARD_TANKS:String = "tanks";
public static const SCORE_BOARD_HEALTH:String = "health";
//custom sounds
public static const SOUND_ENEMY_FIRE:String = "enemyfire";
public static const SOUND_EXPLODE:String = "explode"
public static const SOUND_PLAYER_EXPLODE:String = "playerexplode";
public static const SOUND_PLAYER_FIRE:String = "playerfire";
public static const SOUND_PLAYER_MOVE:String = "playermove";
public static const SOUND_PICK_UP:String = "pickup";
public static const SOUND_GOAL:String = "goal";
public static const SOUND_HIT:String = "hit";
public static const SOUND_MUSIC:String = "music";
public static const SOUND_HIT_WALL:String = "hitwall";
public static const SOUND_LIFE:String = "soundlife";
public function Main() {
init();
}
override public function init():void {
game = new NoTanks();
game.y = 20;
setApplicationBackGround(640, 500, false, 0x000000);
//add score board to the screen as the seconf layer
scoreBoard = new ScoreBoard();
addChild(scoreBoard);
scoreBoardTextFormat= new TextFormat("_sans", "11", "0xffffff", "true");
scoreBoard.createTextElement(SCORE_BOARD_SCORE, new
Search WWH ::




Custom Search