Game Development Reference
In-Depth Information
We also need to remember to set the IP of the Pulse server. During the development
phase, you may want to show the IP field, but during deployment, you may want to
hide it and set the IP value programmatically.
The login method takes in the IP of the server and port. By default the IP is the
localhost, but could be any IP on the Internet. The Pulse server always listens to port
2021, so the client must pass the same value. For the enterprise edition of Pulse, this
port may be configured.
public function login(ip:String="127.0.0.1",
port:int=2021,
username:String=null,
password:String=null,
sessionId:int=0)
The user name and password may be passed from user input or could be null in case
the player wishes to log in as a guest.
The session ID in most cases can be passed a value of zero. The session ID is
provided for advanced game portal implementation where a user gets assigned a
session ID from the web portal implementation. From then on, the player may jump
from one page to another, containing different games. In this case, for providing
the user name and the session ID, the user need not log in every time a new game is
attempted to be played.
The screen class
This is the base class for all the screen classes. It defines the bare minimum methods
such as init, show, and hide. Each subclass then overrides these methods for their
specific sprite management.
public class Screen extends Sprite
{
protected var m_showing:Boolean;
public function Screen() {
}
public function init():void {
}
public function show():void {
if ( m_showing ) {
trace("Already showing!");
return;
}
m_showing = true;
}
public function hide():void {
 
Search WWH ::




Custom Search