I want to make a button so that when I click it, my game starts and the button goes away, and then when the game ends the button re-appears and restarts the game. Does anybody know how I can do this?
public void clickButton()
{
if(Greenfoot.mouseClicked(this))
{
Greenfoot.setWorld(new Level1());
Greenfoot.playSound("ButtonSound.mp3");
}
}