public class LabBuggleWorld extends BuggleWorld {
public void run () {
LabBuggle barb = new LabBuggle();
Color c = Color.blue;
barb.forward(2);
barb.turnAround();
barb.jump(2,3);
barb.colorTwo(c.darker());
barb.isOverBagel();
}
}
class LabBuggle extends Buggle {
public void turnAround () {
this.left();
this.left();
}
public double jump (int right, int up) {
Point p = this.getPosition();
this.setPosition(new Point(p.x+right, p.y+up));
return this.distanceFromStart();
}
public double distanceFromStart () {
Point p = getPosition();
int x = p.x-1;
int y = p.y-1;
return Math.sqrt((x*x)+(y*y));
}
public void colorTwo (Color c) {
forward();
setColor(c);
backward();
}
}