예제 #1
0
  public void setVelocityY() {
    System.out.println("up: " + up + ", down: " + down);
    int multiple = 0;
    if (up > down) {
      multiple = 1;
    } else if (down > up) {
      multiple = -1;
    }

    pc.setVelocityY(VERTICAL_VELOCITY * multiple);
  }
예제 #2
0
  public void setVelocityX() {
    System.out.println("left: " + left + ", right: " + right);
    int multiple = 0;
    if (left > right) {
      multiple = -1;
    } else if (right > left) {
      multiple = 1;
    }

    pc.setVelocityX(HORIZONTAL_VELOCITY * multiple);
  }