Wander.java
package prey;
 
import java.util.Random;
 
public class Wander extends Behavior {
    private Random rand = new Random();
 
    public Wander(String name, int priority) {
        super(name, priority);
    }
 
    @Override
    public int getMotivation() {
        return 1;
    }
 
    @Override
    public void action() throws InterruptBehaviorException {
        Mover.forward(70, 70);
        delay(1000 + rand.nextInt(1000));
        Mover.turnInRandomdirection(70, false);
        delay(200 + rand.nextInt(1500));
    }
 
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License