Explorar o código

fix undeclared - boolean value (#119)

Ertuğrul Çetin %!s(int64=4) %!d(string=hai) anos
pai
achega
601dbe4955
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  1. 5 5
      docs/modules/tutorials/pages/beginner/hello_collision.adoc

+ 5 - 5
docs/modules/tutorials/pages/beginner/hello_collision.adoc

@@ -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));}
     }