BaseGameController Class
Class org.rapo.games.BaseGameController
Inheritance
>
BaseGameController
Facilitates communication between game objects and the game's main timeline.
BaseGameController should be subclassed by a game-specific GameController class
| Constructor Summary |
|---|
| | Serves as the 'main loop' of the application. |
| Property Summary |
|---|
| String | Key sequence container used to activate the debug console |
| MovieClip | A reference to the game container's timleline, if it exists |
| Array | Contains a queue of debug messages |
| MovieClip | A reference to the dynamically loaded game engine SWF |
| MovieClip | A reference to the main timleline of the game SWF |
| Timer | A org.rapo.games.Timer instance used to set the interval at which keyboard input is read |
| Timer | A org.rapo.games.Timer instance used to determine the amount of time that the game pauses between levels |
| Boolean | A flag indicating whether or not the game is paused |
| MovieClip | A MovieClip to hold game sound instances |
| Method Summary |
|---|
| Boolean | Should contain logic to determine if the game over conditions have been met. |
| Boolean | Should contain logic to determine if the level complete conditions have been met. |
| | |
| Void | Called from the game's main timeline when the "gameOver" frame is reached. |
| Number | Used to get the current time per frame. |
| Number | Should be overridden in game-specific GameController. |
| Number | Should be overridden in game-specific GameController. |
| Number | Should be overridden in game-specific GameController. |
| Void | Utilizes the InputManager class to detect and route keyboard input. |
| Void | Called from the game's main timeline when the "instructions" frame is reached. |
| Void | Called from the game's main timeline when the "levelComplete" frame is reached. |
| Void | Called from the game's main timeline when the "nextLevel" frame is reached. |
| Void | Called from the game's main timeline when the "mainLoop" frame is reached. |
| Void | Called from the game's main timeline when the "play" frame is reached. |
| Void | Should be overridden in game-specific GameController. |
| Void | Should be overridden in game-specific GameController. |
| Void | Called from the game's main timeline when the "start" frame is reached. |
| Void | Called from the game's main timeline when the "title" frame is reached. |
| Void | win(level:Number, score:Number) Called from the game's main timeline when the "win" frame is reached. |
BaseGameController
public function BaseGameController(game_timeline:MovieClip, engine_clip:MovieClip)
Serves as the 'main loop' of the application.
Parameters:
game_timeline- A reference to the main timleline of the game SWF
consoleCode
public var consoleCode:String;
Key sequence container used to activate the debug console
containerTimeline
public var containerTimeline:MovieClip;
A reference to the game container's timleline, if it exists
debugMsgList
public var debugMsgList:Array;
Contains a queue of debug messages
engineClip
public var engineClip:MovieClip;
A reference to the dynamically loaded game engine SWF
gameTimeline
public var gameTimeline:MovieClip;
A reference to the main timleline of the game SWF
inputTimer
A org.rapo.games.Timer instance used to set the interval at which keyboard input is read
levelPauseTimer
var levelPauseTimer:
Timer;
A org.rapo.games.Timer instance used to determine the amount of time that the game pauses between levels
pause
var pause:Boolean;
A flag indicating whether or not the game is paused
soundClipContainer
public var soundClipContainer:MovieClip;
A MovieClip to hold game sound instances
checkGameOver
public function checkGameOver():Boolean
Should contain logic to determine if the game over conditions have been met.
Should be overridden in a game-specific GameController class
Parameters:
checkLevelComplete
public function checkLevelComplete():Boolean
Should contain logic to determine if the level complete conditions have been met.
Should be overridden in a game-specific GameController class
Parameters:
gameDebug
public function gameDebug(msg:String)
gameOver
public function gameOver(level:Number, score:Number):Void
Called from the game's main timeline when the "gameOver" frame is reached.
Invoke's the GameController's "gameOver" sequence.
Should be overridden in a game-specific GameController class
Parameters:
getFrameTime
public function getFrameTime():Number
Used to get the current time per frame.
Parameters:
getLevel
public function getLevel():Number
Should be overridden in game-specific GameController.
Parameters:
getScore
public function getScore():Number
Should be overridden in game-specific GameController.
Parameters:
getTotalScore
public function getTotalScore():Number
Should be overridden in game-specific GameController.
Parameters:
handleInput
public function handleInput():Void
Utilizes the InputManager class to detect and route keyboard input.
Should be overridden in a game-specific GameController class
Parameters:
instructions
public function instructions():Void
Called from the game's main timeline when the "instructions" frame is reached.
Invoke's the GameController's "instructions" sequence.
Should be overridden in a game-specific GameController class
Parameters:
levelComplete
public function levelComplete():Void
Called from the game's main timeline when the "levelComplete" frame is reached.
Invoke's the GameController's "levelComplete" sequence.
Should be overridden in a game-specific GameController class
Parameters:
levelStart
public function levelStart(level:Number, score:Number):Void
Called from the game's main timeline when the "nextLevel" frame is reached.
Invoke's the GameController's "nextLevel" sequence, which typically initializes the level.
Should be overridden in a game-specific GameController class
Parameters:
mainLoop
public function mainLoop():Void
Called from the game's main timeline when the "mainLoop" frame is reached.
This method is invoked every frame while the game is playing.
This can either be accomplished by looping over the "mainLoop" frame or by setting the game timeline's onEnterFrame handler to call this method.
Should be overridden in a game-specific GameController class
Parameters:
play
public function play():Void
Called from the game's main timeline when the "play" frame is reached.
Invoke's the GameController's "play" sequence,which typically initializes the game.
Should be overridden in a game-specific GameController class
Parameters:
setLevel
public function setLevel(value:Number):Void
Should be overridden in game-specific GameController.
Parameters:
setScore
public function setScore(value:Number):Void
Should be overridden in game-specific GameController.
Parameters:
start
public function start():Void
Called from the game's main timeline when the "start" frame is reached.
Invoke's the GameController's "start" sequence.
Should be overridden in a game-specific GameController class
Parameters:
title
public function title():Void
Called from the game's main timeline when the "title" frame is reached.
Invoke's the GameController's "title" sequence.
Should be overridden in a game-specific GameController class
Parameters:
win
public function win(level:Number, score:Number):Void
Called from the game's main timeline when the "win" frame is reached.
Invoke's the GameController's "win" sequence.
Should be overridden in a game-specific GameController class
Parameters:
Documentation generated by BLDoc Community Edition from B-Line Express.