Prev | Current Page 828 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

attend();
else
placeSymbol();
}
private function placeSymbol()
{
var x = board._xmouse;
var y = board._ymouse;
for(r in 0...3)
{
if(y < offset || y > (side*(r+1)+offset))
continue;
for(c in 0...3)
if(x > offset & & x < (side*(c+1)+offset))
{
server.place(r, c);
return;
}
}
}
private static var offset = 20;
private static var side = 120;
private static var fontname = ???Arial???;
private static var fontsize = 20;
private static var fontcolor = 0x006699;
private static var linewidth = 10;
private static var linecolor = 0xcc6600;
}
The PlayerServer is the class that represents a user on the server. It contains the main logic and
execution flow of the game. Every instance has a reference to a GameBoard instance that can be null
when the player is not playing and waiting for an adversary. Once a game session is started, the player
can be the first or the second player and can be currently active, enabled to move, or not. The instance
also maintains a reference to the other player in the game.


Pages:
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840