Scratch Spirals - The Creative Computer Lab

Spirals
With Scratch
Spring 2014
The Creative Computer Lab
creativecomputerlab.com
Check Out This Polygon Creator:
 http://scratch.mit.edu/projects/2152290
 Check out this Spiral Creator:
 http://scratch.mit.edu/projects/2325450
Create a Polygon Given User Input
 Look at this polygon creator:
http://scratch.mit.edu/projects/2152290
 Let’s see how we can build this…
 Remember how to draw a square?
Get Data From the User
 Instead of drawing a 4 sided square every time, we’re going
to ask the user how many sides they want to draw:
Processing the User Input
 We now know the number of sides the user wants, but, how
are we going to draw the shape that they want?
 Hints:
 How many times does the loop repeat?
 How many degrees does the sprite turn for each side?
 How many degrees does the sprite need to turn for:
 A pentagon?
 A hexagon?
 A 7 sided polygon?
 An octagon?
 A 9 sided polygon?
 What calculation are you doing in your head?
 Can this be done by a script?
Finished Work:
Spiral Time
 Spirals vary in size. They start out small and gradually get
bigger and bigger.
 How do we control the size of the square?
Create a Variable for the Size
 Make sure the square is drawn as before.
 Experiment with different sizes
Draw a Growing Square in a Loop
 We are going to start with a small size of 1 and grow the size
of the square in the loop by adding 1 to the size variable each
time the loop runs.
 If we start out with size equal to 1 and loop for 100 times,
what size is the square after the loop has finished?
Draw Different Polygon Spirals
 Try drawing a pentagon spiral. Set the degrees to 72:
Perimiter
How long is the line?
How can we calculate the length?
Twist the Spiral
 See what happens when you add or subtract 1 from the
degrees of a polygon: