I have the following in my update funtion. The first input for key_enter when textPos!=2 works fine, but the one when textPos==2 doesn't work. The key up and down work fine though.
The System.out.println("Enter: " + choice); never gets printed
public void update() {
Input input = gc.getInput();
if (input.isKeyPressed(Input.KEY_ENTER)) {
if (textShowing && textPos != 2) {
textPos++;
textShowing = false;
}
}
if (textShowing && textPos == 2) {
if (input.isKeyPressed(Input.KEY_ENTER)) {
System.out.println("Enter: " + choice);
if (choice == 0) {
} else if (choice == 1) {
} else {
textPos++;
textShowing = false;
System.out.println("Text Pos: " + textPos);
}
} else if (input.isKeyPressed(Input.KEY_UP)) {
if (choice > 0) {
choice--;
}
} else if (input.isKeyPressed(Input.KEY_DOWN)) {
if (choice < 2) {
choice++;
}
}
}
}
textShowingand the value oftextPos. \$\endgroup\$