public void endGame()
{
if (getOneIntersectingObject(Obstacle.class) != null)
{
World world = getWorld();
Greenfoot.playSound("gameover.wav");
getWorld().removeObject(this);
//gameOver();
world.removeObjects(world.getObjects(null));
world.setBackground("Gameover.png");
Greenfoot.stop();
}
}