int connect_inter(int *sock, sockaddr_in *inter) { hostent *he; if(!preparar(sock, inter, he, 10500)) return 0; if(!conectar(*sock, inter)) return 0; return 1; }
void do_echo(int *sock, char *buf, sockaddr_in *serv, hostent *he, int port) { if(!port) { port = get_porta(); } if(!preparar(sock, serv, he, port)) return 0; if(!conectar(*sock, serv)) return 0; if(!enviar(*sock, buf)) return 0; return 1; }
void Game::update(int a) { if (a == 1){ preparar(); } else{ if(asteroides.size() >= 0){ for (int i = 0; i < asteroides.size(); i++){ if (!asteroides[i].estaDentro()) { asteroides.erase(asteroides.begin() + i); addAsteroide(); addAsteroide(); } } } hayCollision(); mover(); } }