Hello!
If this has been covered before, I apologize. I am working through the Joy of code series and I see that the method "atWorldEdge" has been replaced by "isAtEdge". My problem is that my turtle scenario won't compile. I am getting an error saying "Identifier expected" and then "Illegal start of type". I realize that code changes but it is frustrating when your documentation is out of date. Here is my code:
Thanks for your help!
public class Turtle extends Actor
{
/**
* Act - do whatever the Turtle wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(4);
if (Greenfoot.getRandomNumber(100) < 10)
{
turn (Greenfoot.getRandomNumber(40) - 20);
}
}
if (isAtEdge())
{
}
}
