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 |
|---|
| 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 |
| 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. |
| 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 "mainLoop" 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 "play" frame is reached. |
| 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 | 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
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
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:
gameOver
public function gameOver():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:
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:
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:
nextLevel
public function nextLevel():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:
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:
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():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.