|
|
@ -17,7 +17,7 @@ const int RECT_H = HEIGHT / 3;
|
|
|
|
const int RECT_W = 30;
|
|
|
|
const int RECT_W = 30;
|
|
|
|
const int PADDLE_SPEED = 8;
|
|
|
|
const int PADDLE_SPEED = 8;
|
|
|
|
const int CIRC_RAD = 10;
|
|
|
|
const int CIRC_RAD = 10;
|
|
|
|
const float BASE_BOUNCE_DEG = 60;
|
|
|
|
const float BASE_BOUNCE_DEG = 45;
|
|
|
|
const float BASE_BOUNCE_RAD = (BASE_BOUNCE_DEG / 180.0) * M_PI;
|
|
|
|
const float BASE_BOUNCE_RAD = (BASE_BOUNCE_DEG / 180.0) * M_PI;
|
|
|
|
const float BASE_SPEED_COMPONENTS = 18;
|
|
|
|
const float BASE_SPEED_COMPONENTS = 18;
|
|
|
|
const float BASE_SPEED = sqrt(powf(BASE_SPEED_COMPONENTS, 2) * 2);
|
|
|
|
const float BASE_SPEED = sqrt(powf(BASE_SPEED_COMPONENTS, 2) * 2);
|
|
|
@ -63,8 +63,8 @@ Mode check_server_client(int argc, char** argv, Server* server, Client* client)
|
|
|
|
throw EXCEPT_TOOFEWARGS;
|
|
|
|
throw EXCEPT_TOOFEWARGS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
connect_code = std::string(argv[2]); /* The connect code is a special string, that contains the server address and port. It is given by the server. */
|
|
|
|
connect_code = std::string(argv[2]); /* The connect code is a special string, that contains the server address and port. It is given by the server. */
|
|
|
|
addr_port = connect_code::decode(connect_code);
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
addr_port = connect_code::decode(connect_code);
|
|
|
|
client = new Client(4, 'T', addr_port[0].data(), std::stoi(addr_port[1]));
|
|
|
|
client = new Client(4, 'T', addr_port[0].data(), std::stoi(addr_port[1]));
|
|
|
|
return M_CLIENT;
|
|
|
|
return M_CLIENT;
|
|
|
|
} catch (int e) {
|
|
|
|
} catch (int e) {
|
|
|
@ -270,6 +270,7 @@ int main(int argc, char** argv) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
window.Close();
|
|
|
|
window.Close();
|
|
|
|
|
|
|
|
sock_quit();
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|