Game Development Reference
In-Depth Information
(m_gameScreen as HelloGameScreen).onUpdateGS(gameState);
}
public override function
onRemoveGameState(gameState:GameStateClient):void {
(m_gameScreen as HelloGameScreen).onRemoveGS(gameState);
}
That's it for the main class! The reason why it seems so simple to write games based
on PulseUI is that all the game mechanics are handled by PulseUI framework. What
we are doing is simply modifying the default behavior.
The login screen
The login screen is the first screen to be shown for any multiplayer game:
It offers two buttons, one being the Guest button for which the player need not type
any username or password. In this case, the player will be logged in as a guest. If
the player does have a username and password, the player needs to click on the OK
button after filling in the fields.
The login class allows one to customize the login screen, so the server IP does not
show up in the login screen. After creating the login screen, we may simply call the
showIP method and pass false . The best place to call the method is by overriding
the initLoginScreen in your subclass of PulseGame class as follows:
protected override function initLoginScreen():void {
super.initLoginScreen();
m_login.setIP("127.0.0.1");
m_login.showIP(false);
}
 
Search WWH ::




Custom Search