Game Development Reference
In-Depth Information
import flash.text.TextField;
import flash.text.TextFormatAlign;
import flash.geom.Point;
import flash.events.Event;
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_LEVEL:String = "level";
public static const SCORE_BOARD_SHIELD:String = "shield";
public static const SCORE_BOARD_PARTICLE_POOL:String = "particlepool";
public static const SCORE_BOARD_PARTICLE_ACTIVE:String = "particleactive";
public static const SCORE_BOARD_PROJECTILE_POOL:String = "projectilepool";
public static const SCORE_BOARD_PROJECTILE_ACTIVE:String = "projectileactive";
//custom sounds
public static const SOUND_MINE_EXPLODE:String="SoundMineExplode";
public static const SOUND_MUSIC_IN_GAME:String="SoundMusicInGame";
public static const SOUND_MUSIC_TITLE:String="SoundMusicTitle";
public static const SOUND_PLAYER_ENTER:String = "SoundPlayerEnter";
public static const SOUND_PLAYER_EXPLODE:String="SoundPlayerExplode";
public static const SOUND_PLAYER_HIT:String="SoundPlayerHit";
public static const SOUND_PLAYER_SHOOT:String = "SoundPlayerShoot";
// Our construction only calls
public function Main() {
//added in chapter 11
if (stage) addedToStage();
else addEventListener(Event.ADDED_TO_STAGE, addedToStage,false,0,true);
}
//function added in chapter 11
override public function addedToStage(e:Event = null):void {
if (e != null) {
removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
super.addedToStage();
trace("in blastermines added to stage");
init();
}
// init() is used to set up all of the things that we should only need to do one time
override public function init():void {
trace("init");
game= new BlasterMines();
Search WWH ::




Custom Search