Game Development Reference
In-Depth Information
switchSystemState(FrameWorkStates.STATE_SYSTEM_WAIT);
nextSystemState = FrameWorkStates.STATE_SYSTEM_GAME_PLAY;
addEventListener(EVENT_WAIT_COMPLETE, waitCompleteListener, false, 0, true);
}
public function systemGameOver():void {
removeChild(game);
addChild(gameOverScreen);
gameOverScreen.addEventListener(CustomEventButtonId.BUTTON_ID,
okButtonClickListener, false, 0, true);
switchSystemState(FrameWorkStates.STATE_SYSTEM_WAIT_FOR_CLOSE);
nextSystemState = FrameWorkStates.STATE_SYSTEM_TITLE;
}
public function systemGamePlay():void {
game.runGame();
}
public function systemWaitForClose():void {
//do nothing
}
public function systemWait():void {
waitCount++;
if (waitCount > waitTime) {
waitCount = 0;
dispatchEvent(new Event(EVENT_WAIT_COMPLETE));
}
}
public function okButtonClickListener(e:CustomEventButtonId):void {
switch(e.id) {
case FrameWorkStates.STATE_SYSTEM_TITLE:
removeChild(titleScreen);
titleScreen.removeEventListener(CustomEventButtonId.BUTTON_ID,
okButtonClickListener);
break;
case FrameWorkStates.STATE_SYSTEM_INSTRUCTIONS:
removeChild(instructionsScreen);
instructionsScreen.removeEventListener(CustomEventButtonId.BUTTON_ID,
okButtonClickListener);
Search WWH ::




Custom Search