bool onPosto(Helicopter player, Rect posto){ if(player.getGunPosX() > posto.getX() && player.getGunPosX() < (posto.getX() + posto.getWidth()) && player.getGunPosY() > posto.getY() && player.getGunPosY() < (posto.getY() + posto.getHeight()) ){ // on posto return true; } // left posto return false; }
void mouse(int button, int state, int x, int y){ if(button == GLUT_RIGHT_BUTTON && state == GLUT_DOWN){ player.setFlying(); } if(button == GLUT_LEFT_BUTTON && state == GLUT_DOWN && player.getFlying()){ // playerShots.push_back(Shot(player.getGunPosX(), // player.getGunPosY(), // player.getCurrentAngleGun(), // player.getAngle(), // player.getVelTiro(), // player.getAngleGun())); playerShots.push_back(Shot(player.getGunPosX(), player.getGunPosY(), player.getCurrentAngleGun(), player.getAngle(), player.getVelTiro(), player.getAngleGun())); } }