my current code for it:
this should add a text (png) saying you lose, and remove the character, but it does not seem to work
public void outOfWorld()
{
if (getY() >= 1600)
{
getWorld().addObject (new YouLose(), 800,300);
getWorld().removeObject(this);
Greenfoot.stop();
}
}