I am making a game like flappy bird called flappy pig. I have written a code so that when you die your score comes up and a play button, but when you die the bird keeps on moving which means you can keep on playing. How do I stop that from happening?
public void gameOver(int score) {
addObject(new GameOver(score), getWidth() / 2, getHeight() / 2);
Click button = new Click();
addObject(button, 306, 74);
}

