I am having problems on making a code where the player moves on to the next level if they're at the (right edge) of the world. What could be a possible code for this action?
if (getX() > getWorld().getWidth()-2)
{
Greenfoot.setWorld( ---next level--- );
}