Drawing Shapes Using Angles Name ______________________ Today you are going to teach the Scratch cat to make this shape, except, it will be in a rainbow of colors! When you do this packet, be sure to write the answers to fill-in-the-blanks that you see in this packet. You will also learn more about some of Scratch’s most important blocks-- the repeat block, the math operations, and the pen blocks. As you complete this program, you should try to figure it out yourself, but if you have trouble, you can look at the Hints on the last page! Step 1: Prepare to Draw The first step is to prepare to draw on the screen. Create a new Scratch project and then click on the cat sprite in the lower left corner. Add the following script: Now, whatever you add after this script will draw stuff! Note that if you want, you can show the cat instead of hiding him, and just make him smaller. If you do this, you will be able to see which way he is facing when he is drawing. Then your program will look like this: Step 2: Draw a square. The cat might be invisible when you click the green flag. But he’s still going to be doing the drawing. So pretend to be the cat. How would you draw a simple shape, like a square? Let’s say the square should be 50 steps on a side. Your choices under the Motion tab in Scratch include moving forward a certain number of steps, and turning left or right a certain number of degrees. How could you make the cat draw a square using these steps? How many degrees would you turn at each corner? Write your guess here: ______________ Now, try adding to your program so that it draws a square. If you have trouble, see Hint 1 and Hint 2. Step 3: Make your square more efficient. Did you use the repeat block under Control to make your square? If you didn’t, you should learn how. The repeat block lets you repeat the same instructions a certain number of times. So instead of saying “move 50 steps, then turn right 90 degrees, then move 50 steps, then turn right 90 degrees, then move 50 steps, then turn right 90 degrees, then move 50 steps,” you can tell the cat to repeat the steps that are the same. Here’s how you will change your script: • • Drag the repeated instructions away from your script. Drag them to the toolbox area, and they will disappear-- you don’t need those repeated instructions any more. Click on the “Control” (orange) section. Drag a Repeat block towards your one remaining pair • • of instructions-- the ones that say “move 50 steps” and “turn right (or left) 90 degrees”. When you do this, the repeat block will wrap around the steps. Change the number in the repeat block so it’s the right number of times for a square (4). Check to see if it still draws a square! Step 4: Now make other polygons! Look closely at the shape at the beginning of this lesson. Does it contain polygons? You bet! So we’re going to have to learn how to draw other polygons besides squares. Now, for a square, you had to turn 90 degrees at each of the four corners. 90 + 90 + 90 + 90 = 360-- 360 degrees, or a complete circle! That makes sense, since if you had the cat visible, he ended up pointing up at the end of drawing the square-- he had turned all the way around. If you have five sides and you want each turn to be equal, what do you think the angle is going to be that you are going to have to turn? What equation tells you this? Equation: ____________________________________ Answer: ____________________________________ Now change your program so that it draws a pentagon! If you have trouble, see Hint 3. Step 5: Tell the computer to do the math. One annoying part of Step 4 was that we were doing math, even though there was a computer right in front of us! To have the computer do the math, first click on the green Operators choice in Scratch. This will give you various green blocks you can use: Drag the appropriate one to the little circle where you have typed the angle to turn. Then you can fill in the numbers from the equation, that you wrote in Step 4, and the computer will figure out the answer for you! You can drag these operator blocks to any place where you can type a number. Now that the computer is doing the math, try making it draw an octagon! (If you have trouble, see Hint 4.) Step 6: Make your program easier to change, with a variable. Did you remember to change all the right places in order to change your program from a pentagonmaker to an octagon-maker? If we put the number of sides into a variable, we will only have to change it one place! Here’s how: • Click on the dark-orange “Data” section in Scratch. • Click on “Make a Variable.” • • • • • • Name your variable “number of sides” (don’t include the quotation marks). Leave the checkbox checked that says “for all sprites”-- that means you can use the variable anywhere, even if you have more than one cat (or other object) on the screen. Click OK. If you did it right, you will see new choices like this: Drag a “set number of sides” block to the beginning of your program. Set the number of sides to 8, so it still makes an octagon. Drag the oval-shaped “number of sides” block to the places in your program where you used to type the number of sides. If you do it right, it will look like this: See if it still makes an octagon! Then, change the number in the “set number of sides” block and see if that changes which shape your program makes! Step 7: Make the cool shape at the start of this lesson, with one color. Take a look at the cool shape we set out to draw. I’ve highlighted some things to notice about it: And of course you already have a program that makes an octagon! To make the fancy shape, all you would have to do is repeat the drawing of the octagon, over and over again, turning 15 degrees after each one. How many times would you need to repeat, in order to make this shape? Write your guess here: Equation for the number of times to repeat: ____________________________________ Now change your program to make this shape. See Hint 5 if you have trouble. Step 8: Add color! The shape I made has different colors for every octagon. You can do this by dragging the “change pen color by …” block (from the green Pen section) into your program right after it finishes drawing the octagon! Step 9: Share! Be sure to share your project with me so I can grade it. Then, try experimenting with it. What happens when you change the number of steps? What happens when you change the angle of 15 degrees between octagons? What else do you have to change when you do this? What happens when you change the number of sides? Does the overall shape stay the same? The cat won’t go beyond the edge of the screen. Does this mess up your shape as you make it bigger? See if you can change the program to ask you how many sides you want to use. Use the “ask” and “answer” blocks under “Sensing,” like this: Can you add more variables and use “ask” some more in order to have the computer ask you about other things, like the number of steps or the angle to use? HINTS Hint 1: Remember that each corner of a square is a right angle-- a 90 degree angle-- so you should turn right (or left) 90 degrees at each corner of the square. Hint 2: The steps you will need to program, using the Motion section of Scratch, are to move 50 steps, then turn right 90 degrees, and you need to do this four times to make the four sides of the square. Hint 3: When you drew the square, you turned the cat a total of 360 degrees, but you divided those degrees into 4 equals parts in order to make 4 sides. So how many equal parts will you need to divide the degrees into in order to have 5 sides? Does this help you figure out the equation for the number of degrees to turn to make a pentagon? Hint 4: Your pentagon code may look like this: What will you change to make it draw an octagon instead? Hint 5: Again, the goal is to repeat (using a repeat block) the entire process of making the octagon, and after each octagon is drawn, turn 15 degrees. If you have trouble getting your program blocks to do what you want, remember that the repeat block (or any other control block) will try to wrap around all the steps below where your mouse cursor is. If you want to remove a block, you can drag the block and it will move-- along with all the other ones below it. Then you can drag the other ones back to where you want them by holding the mouse button down on top of the first step you want to move. You can delete steps from the program entirely by dragging them off to the toolbox area on the left.
© Copyright 2026 Paperzz