diff --git a/clerks/Turtle/Turtle.java b/clerks/Turtle/Turtle.java index 5ac9546..ac560c2 100644 --- a/clerks/Turtle/Turtle.java +++ b/clerks/Turtle/Turtle.java @@ -66,4 +66,9 @@ Turtle lineWidth(double width) { Clerk.call(view, STR."turtle\{ID}.lineWidth('\{width}');"); return this; } + + Turtle reset() { + Clerk.call(view, STR."turtle\{ID}.reset();"); + return this; + } } diff --git a/clerks/Turtle/turtle.js b/clerks/Turtle/turtle.js index 85b35a5..091107d 100644 --- a/clerks/Turtle/turtle.js +++ b/clerks/Turtle/turtle.js @@ -6,11 +6,12 @@ class Turtle { } reset() { + this.ctx.reset(); this.x = this.canvas.width / 2; this.y = this.canvas.height / 2; this.angle = 0; - this.isPenDown = true; - this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); + this.penDown(); + this.color("black"); } penDown() {