|
@@ -448,15 +448,15 @@ Remember that this class implements the `ActionListener` interface, so you can c
|
|
|
[source,java]
|
|
|
----
|
|
|
|
|
|
- public void onAction(String binding, boolean value, float tpf) {
|
|
|
+ public void onAction(String binding, boolean isPressed, float tpf) {
|
|
|
if (binding.equals("Left")) {
|
|
|
- if (value) { left = true; } else { left = false; }
|
|
|
+ left = isPressed;
|
|
|
} else if (binding.equals("Right")) {
|
|
|
- if (value) { right = true; } else { right = false; }
|
|
|
+ right= isPressed;
|
|
|
} else if (binding.equals("Up")) {
|
|
|
- if (value) { up = true; } else { up = false; }
|
|
|
+ up = isPressed;
|
|
|
} else if (binding.equals("Down")) {
|
|
|
- if (value) { down = true; } else { down = false; }
|
|
|
+ down = isPressed;
|
|
|
} else if (binding.equals("Jump")) {
|
|
|
if (isPressed) { player.jump(new Vector3f(0,20f,0));}
|
|
|
}
|