Hello I am new to Greenfoot programming and I want help for my lizard to move at edge of the world. My teacher told me to look up the code given in the "Creature" Class - "public class Creature extends Actor
{
public boolean atEdgeOfWorld()
{
return getX()<5 || getY()<5 || getX()>getWorld().getWidth()-5 || getY()>getWorld().getHeight()-5;
}
}"
which I did but couldn't understand anything. It's from the game "TurtleAndLizard" ; I want it to turn 7 degrees. please response quickly as I have to submit it tomorrow first thing in the morning.
Thank You very much : )
public class Creature extends Actor
{
public boolean atEdgeOfWorld()
{
return getX()<5 || getY()<5 || getX()>getWorld().getWidth()-5 || getY()>getWorld().getHeight()-5;
}
}

