FUNCTION main()
{
randomize(); // set random seed
level_load (level_str);
wait (2); // wait for the level to be loaded
clip_size = 0; // show all the triangles for all the models
//Loco03
// if not a single player game, wait for connection
ifdef server;
while(connection== 0) {wait(1);} // wait until level loaded and connection set
endif;
ifdef client;
while(connection== 0) {wait(1);} // wait until level loaded and connection set
endif;
//Loco03
if(connection == 2) // client
{
while (temp_player_number == 0) // wait for server to assign client player number
{
wait(1);
}
}
CalculateFPS();
init_chat();
InitDebug(); //Loco02
Debug(); //Loco02
sleep(.5); //Loco03
//Loco03
// if dedicated server skip these
if(connection != 1)
{
camera.visible = on; // turn camera on
create_player(); // create player
input_scan(); // get inputs
move_camera(); // simple 3rd Person chase camera code
spells();
}
while(1)
{
// if server quit, exit game on all clients too
if((game_quit == TRUE) && (connection == 2))
{
exit;
}
// on display player# if host(server/client) or client
if(connection == 2 || connection == 3)
{
// continuely show player number, player number can be changed if other
// players quit as written now
str_cpy(strPlayerNumber, "Player#:");
str_for_num(strTemp, player_number);
str_cat(strPlayerNumber, strTemp);
txtPlayerNumber.visible = ON;
}
wait(1);
}
}