Hi,
I have got two buttons, one to restart:
thats in gameoverObjects.class
and one to start:
that's in startScreenObjects.class
The problem that I have is that if I hold the "enter" or "space" key when on the gameover screen it will start the level world with only a small glimpse of the startscreen. How do I prevent this from happening?
private void restartGame()
{
if (Greenfoot.mousePressed(this) || Greenfoot.isKeyDown("enter") || Greenfoot.isKeyDown("space"))
{
Greenfoot.setWorld(new StartScreen());
}
}private void startGame()
{
if (Greenfoot.mousePressed(this) || Greenfoot.isKeyDown("enter") || Greenfoot.isKeyDown("space"))
{
Greenfoot.setWorld(new Level());
}
}

