public void left(boolean set) { System.out.println("Left: " + set); if (!set) { left = Math.max(left - 1, 0); } else { this.left += 1; } setVelocityX(); }
public void right(boolean set) { System.out.println("Right: " + set); if (!set) { right = Math.max(right - 1, 0); } else { this.right += 1; } setVelocityX(); }
public void down(boolean set) { System.out.println("Down: " + set); if (!set) { down = Math.max(down - 1, 0); } else { this.down += 1; } setVelocityY(); }
public void up(boolean set) { System.out.println("Up: " + set); if (!set) { up = Math.max(up - 1, 0); } else { this.up += 1; } setVelocityY(); }