I'm using libGdx to create a simple platformer.
I used a set of images as an onScreen controller for Android, and use this code to fire a shot ->
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
downPressed = true;
return true;
//return super.touchDown(event, x, y, pointer, button);
}
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
downPressed = false;
//super.touchUp(event, x, y, pointer, button);
}
But when I keep the button pressed, the player continues to shoot which I don't want, I want the player to tap-to-shoot.
What am I doing wrong?