I want to end the game after winning by one of the player. Game should end when Gameover box appears .
Add a 'Greenfoot.stop();' statement immediately after having the Gameover box added into the world. You can also add the following method to your World subclass:
public void started()
{
if (!getObjects(Gameover.class).isEmpty()) Greenfoot.stop();
}
This is so the user is not able to restart (unpause) the game.