I am trying to make the camera jump in my LWJGL program. I've tried writing an if/else statement that would say, "when you get to this position, go to default, starting position." So far it just continues to fly up. Here's my code:
if (flyUp && !flyDown) {
double newPositionY = (walkingSpeed * 0.0002) * delta;
position.y -= newPositionY;
if(position.y > .0002) {
position.y += newPositionY;
}
}
Variables:
boolean flyUp = Keyboard.isKeyDown(Keyboard.KEY_SPACE);
boolean flyDown = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);