Game Development Reference
In-Depth Information
public function runGame(e:TimerEvent):void {
systemFunction();
frameCounter.countFrames();
}
public function runGameEnterFrame(e:Event):void {
timeDifference = getTimer() - lastTime
lastTime = getTimer();
systemFunction();
frameCounter.countFrames();
}
public function switchSystemState(stateval:int):void {
lastSystemState = currentSystemState;
currentSystemState = stateval;
trace("currentSystemState=" + currentSystemState)
switch(stateval) {
case FrameWorkStates.STATE_SYSTEM_WAIT:
systemFunction = systemWait;
break;
case FrameWorkStates.STATE_SYSTEM_WAIT_FOR_CLOSE:
systemFunction = systemWaitForClose;
break;
case FrameWorkStates.STATE_SYSTEM_TITLE:
systemFunction = systemTitle;
break;
case FrameWorkStates.STATE_SYSTEM_INSTRUCTIONS:
systemFunction = systemInstructions;
break;
case FrameWorkStates.STATE_SYSTEM_NEW_GAME:
systemFunction = systemNewGame;
break;
case FrameWorkStates.STATE_SYSTEM_NEW_LEVEL:
systemFunction = systemNewLevel;
break;
case FrameWorkStates.STATE_SYSTEM_LEVEL_IN:
systemFunction = systemLevelIn;
break;
case FrameWorkStates.STATE_SYSTEM_GAME_PLAY:
systemFunction = systemGamePlay;
break
case FrameWorkStates.STATE_SYSTEM_GAME_OVER:
systemFunction = systemGameOver;
Search WWH ::




Custom Search