Implémentation minimal match.java

This commit is contained in:
Antoine
2021-06-02 15:37:41 +02:00
parent bce2220453
commit fbf65f3a6f
2 changed files with 75 additions and 3 deletions

View File

@ -178,7 +178,7 @@ public class GamepadInput {
float magnitude = (float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
float angle = (float) Math.toDegrees(2 * Math.atan(y /(x + magnitude)));
if (magnitude < 0.1) return CENTER;
if (magnitude < 0.3) return CENTER;
if (angle < 22.5 && angle > -22.5) return RIGHT;
else if (angle > -67.5 && angle < -22.5) return UPPER_RIGHT;
else if (angle > -112.5 && angle < -67.5) return UP;