From 67cd559e5f82726906860bd07b4a00dc906dc07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o?= Date: Wed, 16 Jun 2021 12:05:18 +0200 Subject: [PATCH] gamepad1 -> P1 , gamepad2-> P2 --- src/engine/input/GamepadInput.java | 4 ++-- src/gameplay/match/match.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/engine/input/GamepadInput.java b/src/engine/input/GamepadInput.java index cf0fb88..142a95b 100644 --- a/src/engine/input/GamepadInput.java +++ b/src/engine/input/GamepadInput.java @@ -107,8 +107,8 @@ public class GamepadInput { return new Vector3f(x,y); } - public String getGamepadName(){ - return glfwGetJoystickName(this.gamepadNum); + public int getGamepadName(){ + return this.gamepadNum; } } diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 0eb08a3..de61427 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -192,13 +192,15 @@ public class match { if (glfwJoystickPresent(GLFW_JOYSTICK_1)) { gamepad1.inputRefresh(); inputsP1.recordInputsFromGamepad(gamepad1, p1.getPosX() < p2.getPosX()); + handleInputs(p1, inputsP1); } if (glfwJoystickPresent(GLFW_JOYSTICK_2)) { gamepad2.inputRefresh(); - inputsP2.recordInputsFromGamepad(gamepad2, p2.getPosX() <= p1.getPosX()); + inputsP2.recordInputsFromGamepad(gamepad2, p2.getPosX() <= p1.getPosX()); + handleInputs(p2, inputsP2); } - handleInputs(p1, inputsP1); - handleInputs(p2, inputsP2); + + // acCode = 21; break;