function main()
{
fps_max = 60; // limit the number of data packets that are sent each second to 60
///video_screen = 1;
level_load ("dark_frontier.wmb");
vec_set(camera.x, vector (-600, 0, 100)); // set a proper camera position
if (!connection) // no server could be found?
sys_exit(NULL); // then shut down the engine
if (connection == 2) // this instance of the game runs as a client?
{
my = ent_create ("fcc_a.mdl", vector (100, 50, 40), move_players); // then create the red guard!
while (1)
{
my.skill1 = 5 * (key_w - key_s) * time_step;
my.skill2 = 4 * (key_a - key_d) * time_step;
send_skill (my.skill1, SEND_VEC); // send skill1...3 to the server
wait (1);
}
}
if (connection == 3) // this instance of the game runs as a server and client at the same time? (connection = 3)
{
my = ent_create ("cgc_a.mdl", vector (-100, -50, 40), move_players); // create the blue guard
while (1)
{
my.skill1 = 5 * (key_w - key_s) * time_step;
my.skill2 = 4 * (key_a - key_d) * time_step;
wait (1);
}
}
}