Prev | Current Page 832 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

length > 1)
{
var p1 = attendants.pop();
var p2 = attendants.pop();
p1.isPlayerOne = true;
p2.isPlayerOne = false;
p1.board = p2.board = new GameBoard();
p1.other = p2;
p2.other = p1;
p1._turn();
}
if(attendants.length > 0)
attendants.first().client.waitAdversary();
}
public static function addAttendant(p)
{
attendants.add(p);
manageGames();
}
public static function isAttendant(p)
{
return Lambda.has(attendants, p);
}
}
Part II: Server Side, JavaScript, and Flash: Oh My!
452
The client and the server can be compiled using the build.hxml file.
-main GameClient
-swf out/client.swf
-swf-version 8
--flash-strict
-swf-header 400:452:20:ffffff
--next
-main TicTacToeServer
-neko out/server.n
To start the server execution, use the following command from the same directory of server.n :
> neko server.n
You can embed the user interface in a web page that can be executed locally if the security settings have
been adjusted properly or by using the nekotools server or the Apache web server.


Pages:
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844