Hello everybody i'm here to discuss one issue that i'm stuck with, the problem is i've created two classes one called boy and other it called sawdich.
i want to do the reverse of this function turnTowards(x,y); where instead of the sawdich chase the boy it run away from him.
in Sawdich class {
act{
move(1);
boardSawdich();
}
public void boardSawdich(){;
if(isAtEdge()){
int grausSawdich=Greenfoot.getRandomNumber(100);
turn(grausSawdich);
}
}
}
makes the sawdich move until reach the board then turn in some random direction and it keep moving what i want is one function where
i can use turnTowards(); to make the sawdich run away from the boy when a especific range will reached.
