Category: Turtle
Puts the pen down so the turtle draws a line behind it as it moves.
Just like you need to put the pen down on the paper to draw, the turtle pen needs to be put down to draw a line as it moves.
// Draw a line up from the turtle starting postion at the center of the screen. penDown(); moveForward();
Example: Another Line Move the turtle from the center of the screen without drawing a line, then draw a line up.
// Move the turtle from the center of the screen without drawing a line, then draw a line up. penUp(); moveForward(); penDown(); moveForward();
Example: X Marks the Spot Use penUp and penDown to have the turtle draw an 'X', returning the turtle to the starting point.
// Use penUp and penDown to have the turtle draw an 'X', returning the turtle to the starting point. penUp(); move(-100,-100); penDown(); move(200,200); penUp(); move(-100,-100); move(-100,100); penDown(); move(200,-200); penUp(); move(-100,100); |
penDown();
penDown() does not take any parameters.
No return value. Modifies turtle drawing only.
Found a bug in the documentation? Let us know at documentation@code.org
Found a bug in the documentation? Let us know at documentation@code.org