pull/1/head
EmaMaker 2020-03-20 19:27:55 +01:00
commit 4ea08fa700
1 changed files with 8 additions and 4 deletions

View File

@ -30,7 +30,9 @@ int dir, degrees2;
void Goalie::goalie(int plusang) { void Goalie::goalie(int plusang) {
if(ball->distance < CATCH_DIST) drive->prepareDrive(ball->angle, 350, 0); if(ball->distance < CATCH_DIST) drive->prepareDrive(ball->angle, 350, 0);
else{ else{
if(ball->angle > 345 || ball->angle < 15) plusang *= 0.15; /* if(ball->angle > 345 || ball->angle < 15) plusang *= 0.15;
FRONT */
if (ball->angle > 345 && ball->angle < 15) plusang *= 0.15;
if(ball->angle > 180) degrees2 = ball->angle - 360; if(ball->angle > 180) degrees2 = ball->angle - 360;
else degrees2 = ball->angle; else degrees2 = ball->angle;
@ -41,8 +43,10 @@ void Goalie::goalie(int plusang) {
else dir = dir; else dir = dir;
storcimentoPorta(); storcimentoPorta();
if(ball->distance > TILT_DIST && (ball->angle > 340 || ball->angle < 20)) drive->prepareDrive(dir, 350, cstorc); if(ball->distance > TILT_DIST && (ball->angle > 340 || ball->angle < 20)){
else { plusang -= 20;
drive->prepareDrive(dir, 350, cstorc);
} else {
drive->prepareDrive(dir, 350, 0); drive->prepareDrive(dir, 350, 0);
cstorc = 0; cstorc = 0;
} }