Category: Turtle
Picks the pen up so the turtle does not draw a line as it moves.
Just like you sometimes lift your pen when drawing, the turtle pen can be lifted using penUp so the turtle will not draw a line as it moves.
// Move the turtle up from the turtle starting postion at the center of the screen without drawing a line. penUp(); moveForward();
Example: Dotted Line Use penUp and penDown to have the turtle draw a thick, dotted line.
// Use penUp and penDown to have the turtle draw a thick, dotted line. penWidth(3); penDown(); moveForward(); penUp(); moveForward(); penDown(); moveForward(); penUp(); moveForward(); penDown(); moveForward(); |
Example: Pair of Eyes Draw a picture that has disconnected parts (a pair of eyes) using penUp to move between parts.
// Draw a picture that has disconnected parts (a pair of eyes) using penUp to move between parts. hide(); // first eye penDown(); arcRight(360, 25); penUp(); move(25, 10); dot(10); move(-100, -10); // second eye penDown(); arcRight(360, 25); penUp(); move(25, 10); dot(10);
penUp();
penUp() 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