Game Development Reference
In-Depth Information
if ( cqi >= QUADRANT_COUNT ) {
// Reached the end of race, unload
// all quadrants
unloadQuadrant(m_quads[cqi-1] as Quadrant);
unloadQuadrant(m_quads[cqi] as Quadrant);
unloadQuadrant(m_quads[cqi+1] as Quadrant);
var win:ShipWinClient;
win = new ShipWinClient();
win.setStateKey("I Win");
m_pulse.addGameState(win);
var end:Item = new Item(0, 0, Item.SPACE_STATION);
end.x = 0;
end.y = 0;
addChild(end);
removeChild(m_ship);
addChild(m_ship);
m_gameEnd = true;
return;
}
}
Multiplayer implementation
So far we have seen the implementation of different parts of the game. We will now
see how we can make this into a multiplayer game.
For the multiplayer game, we will go through the implementation for the following:
1.
Getting the unique mask for the ship in the race.
2.
Loading the asteroids in the same position in all clients.
3.
Synchronizing each player's ship position on all player's screen.
4.
Figuring out who won the race.
 
Search WWH ::




Custom Search