Skip to content

Commit

Permalink
Merge pull request #33 from denkspuren/development
Browse files Browse the repository at this point in the history
Turtle mit reset()
  • Loading branch information
denkspuren committed Apr 16, 2024
2 parents 50e18a8 + a196cc1 commit 2886d29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions clerks/Turtle/Turtle.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
5 changes: 3 additions & 2 deletions clerks/Turtle/turtle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2886d29

Please sign in to comment.