This is my code as it stands, I was wondering if anyone could suggest an easier way to achieve random movement to the same standard?
public void act()
{
move(4);
if (Greenfoot.getRandomNumber(100) < 10)
{
turn(Greenfoot.getRandomNumber(90) - 45);
}
if (getX() <=5 || getX() >= getWorld().getWidth() - 5)
{
turn(180);
}
if (getY() <=5 || getY() >= getWorld().getHeight() - 5)
{
turn(180);
}
}
}


