/**
 * Created by zulupero on 20/06/16.
 */
public class Bug extends Buggle {
    static final Random rand = new Random();
    public Bug(int posx, int posy, int dir) {
        super(posx, posy, dir);
    }

    public void enRoute() throws InterruptedException {
        setVitesse(2000);
        setX(0);
        
        while(!isSurBiscuit()){
            switch(rand.nextInt(3)){
                case 0:
                    avance(); break;
                case 1:
                    droite(); break;
                case 2:
                    gauche(); break;
            }
        }
        prendBiscuit();
        message("Miam !");
    }
}
