Game Development Reference
In-Depth Information
/**
* Safely adds game room host sprite
*/
private function addGameHost():void {
if ( m_hostDisplayed )
return;
if ( m_gameHost == null )
m_gameHost = Skinner.getGameHost();
m_gameHost.x = 70; m_gameHost.y = 10;
m_sprite.addChild(m_gameHost);
m_hostDisplayed = true;
}
/**
* Safely removes game room host sprite
*/
private function removeGameHost():void {
if ( !m_hostDisplayed )
return;
m_sprite.removeChild(m_gameHost);
m_hostDisplayed = false;
}
The management of the player display is taken care of by the GameScreen class
along with PlayersDisplay and PlayerDisplay classes in the PulseUI framework.
Each player display also contains a small circle, which when clicked on, initiates a
friend request. The circle does not show up for the player himself or herself and for
those who are already friends. The game host is indicated with a star icon with the
player display.
The following figure shows the instances for both classes that are created
within PulseGame:
 
Search WWH ::




Custom Search