Game Development Reference
In-Depth Information
m_outline = (new OutlineClass() as BitmapAsset).bitmapData;
m_ui = (new UIClass() as BitmapAsset).bitmapData;
m_frame = (new FrameClass() as BitmapAsset).bitmapData;
}
}
}
Class JJF
This is the main class for the game and it inherits from the PulseGame in
PulseUI framework.
In addition to the methods we normally override (please refer to examples in
previous chapters), we need to override the methods shown next. Since the
PulseGame implements the GameClientCallback , it handles any updates regarding
the game state notifications from the server. In our implementation, we simply
override them and delegate the notifications to the game screen class.
public override function
onNewGameState(gameState:GameStateClient):void {
// delegate to game screen
(m_gameScreen as Game).onNewGameState(gameState);
}
public override function
onGameStateAction(gameState:GameStateClient):void{
// delegate to game screen
(m_gameScreen as Game).onGameStateAction(gameState);
}
public override function
onGameStateError(gameState:GameStateClient):void{
// delegate to game screen
(m_gameScreen as Game).onGameStateError(gameState);
}
public override function onPlayerTurn():void {
// delegate to game screen
(m_gameScreen as Game).onPlayerTurn();
}
 
Search WWH ::




Custom Search