this is my code so far but is set for it to decide to get a random direction from a whole 360degree angle.
But our professor just changed his mind, in specifically wanting it to either turn up, down, left, or right, randomly.
Thanks in advance for HELP.
/**
* keep count of how many times "act()" has been called.
* If "act()" has been called 5 times, object with turn a random direction from 0 to 360 degrees.
*/
public void called()
{
if (actCounter == 5)
{
turn(Greenfoot.getRandomNumber(360)); //turns, by getting a random number (in degrees) from 0 to 360.
actCounter = 0;
}
}
