I know this is incredibly basic but I happened to be absent the day we covered how to randomly turn right or left
I need the worm to go left or right when its hits the edge of the world and right now he is only going right
public class Worm extends Actor
{
public void act()
{
checkKeypress();
if ( isAtEdge())
{
turn(Greenfoot.getRandomNumber(19) - 18);
}
}
public void checkKeypress()
{
if ( Greenfoot.isKeyDown("left") )
{
move(Greenfoot.getRandomNumber(4) - 6);
}
}
}
