예제 #1
0
 public void left(boolean set) {
   System.out.println("Left: " + set);
   if (!set) {
     left = Math.max(left - 1, 0);
   } else {
     this.left += 1;
   }
   setVelocityX();
 }
예제 #2
0
  public void right(boolean set) {

    System.out.println("Right: " + set);
    if (!set) {
      right = Math.max(right - 1, 0);
    } else {
      this.right += 1;
    }
    setVelocityX();
  }
예제 #3
0
  public void down(boolean set) {

    System.out.println("Down: " + set);
    if (!set) {
      down = Math.max(down - 1, 0);
    } else {
      this.down += 1;
    }

    setVelocityY();
  }
예제 #4
0
  public void up(boolean set) {

    System.out.println("Up: " + set);
    if (!set) {
      up = Math.max(up - 1, 0);
    } else {
      this.up += 1;
    }

    setVelocityY();
  }