added Rightjoystick controls for zangief

This commit is contained in:
Léo 2021-05-21 16:43:45 +02:00
parent 3cf4372912
commit 7bcbad5792

View File

@ -225,13 +225,21 @@ public class Engine {
for (int i =0 ; i < gamepadAxes.capacity(); i++) {
System.out.println(i + " :" + gamepadAxes.get(i));
}
System.out.println();
System.out.println();
System.out.flush();
if (gamepadButton.get(0) ==1 ) { // appuie sur croix(PlayStation) A (Xbox)
token.translate(new Vector3f (speed *-5.0f, 0.0f, 0.0f));
}
if ( (gamepadAxes.get(2) < -0.1 || gamepadAxes.get(2) > 0.1) ) { // de droite à gauche
token.translate(new Vector3f (5*speed * gamepadAxes.get(2), 0.0f, 0.0f));
}
if ( (gamepadAxes.get(3) < -0.1 || gamepadAxes.get(3) > 0.1) ) { // de haut en bas
token.translate(new Vector3f (0.0f, -5* speed * gamepadAxes.get(3), 0.0f));
}
/* Buttons
0 : Croix / A
1: rond /B