Unit 5 NEW‎ > ‎

### 5-1: Using the Pen Block 1

 Lesson 5-1: Using the Pen Block In this lesson, students will watch videos then replicate and modify the code shown in the videos to learn about Scratch's pen blocks. Activities: Watch the following video on using Scratch to draw a square, made by Colleen Lewis:  Next, watch the following video on drawing circles in Scratch:  Complete the following activities to practice using the pen block: Drawing a LineThe sprites carry a secret pen, and whenever you use pen down the sprites will draw a line. For example, select the pen down block followed by the move 100 steps block, and see what happens (to actually see the result, double click on the pen down).  Drawing a SquareDrawing a square is essentially drawing 4 different lines. To draw a square, use the move and turn blocks several times, as shown below. You can change the thickness by using the change pen size by ( ) block or the pen color by using the set pen color to [ ] block, and placing it under the pen down. (Note: you can also create a square by using the repeat block, since the code to make a line is repeated four times to make a square. Additionally, you can make different shapes by changing the angles and number of times the sprite moves).  Drawing an OctagonThe concepts from drawing a square can be directly applied to drawing other shapes, such as a octagon. The only difference is how many lines are drawn and the angles for the turns. Since we are repeating the same motion 8 times, we can use the repeat ( ) block. Also try drawing a triangle, a hexagon, and a dodecagon (a 12-sided shape). Drawing a CircleYou now have the tools to draw all shapes of various colors, thicknesses, and sizes. How would you use the repeat, move, and turn blocks to draw a circle? Think about it as moving 1 step, then turning by 1 degree, with this sequence repeat 360 times for the number of degrees in a circle. Try varying the color and thickness of your circle as well! Try it out yourself and look below if you would like to see what we did! Drawing a Multicolored CircleIf we want to draw a circle that has many colors, we need to change the pen color inside the repeat (360) loop. By changing the pen color inside the loop, we'll cycle through 360 different colors. Drawing a Dotted LineNow, to make a sequence of separate, distinct lines (like a dotted line), use both the pen down and pen up blocks. Think about how you would do that and try it out yourself! If you need help, look below for hints and code. Think of a dotted line as moving a little bit with your pen down, lifting your pen up, moving a little bit, and then repeating the sequence as many time as you would like. Reflection: Where is the pen block located in Scratch?How many degrees are there in a square, a triangle, and a circle?Why is it useful to have a script for reseting all the sprites and clearing the stage?