Dots

The goal
Step 1. Set the stage
Step 2. Delete the cat
Step 3. Create a sprite
Step 4. Create two variables
Step 5. Create the script
Extra Credit!

The Goal

When you click the green flag, the project creates a geometric shape. You can change the shape by moving the slider beneath the turn variable.

Step 1. Set the stage

Make a new project. Then change the color of the stage to black. Can you figure out how to do that?

Step 2. Delete the cat

Delete the cat sprite. Hint! Use the scissors tool. Can you figure out how to do that?

Step 3. Create a sprite

Create a sprite that is a small purple dot.

Step 4. Create two variables

Create a variable and name it steps.

Just to the left of the new variable’s name is a checkbox. Click the checkbox to remove the check so that the variable doesn’t show on the main playing screen.

At the beginning of your script, set steps to 5.

Create a second variable and name it turn.

You’ll notice that the slider has a maximum value of 100, but we’d like the maximum value to be the same as the number of degrees in a circle — 360. To change the slider’s minimum and maximum values, press and hold the ctrl key and then click the slider (on Macintosh) or right-click (on Windows). Select set slider min and max. On the next screen, type 0 and 360, and then click OK.

Drag the slider so that the turn variable is around 75.

Step 5. Create the script

At the beginning of the script…
* clear any previous lines drawn by the pen
* set the steps variable to 5

Create a loop that repeats 150 times. Inside the loop:

* make the sprite go to the center of the screen
* move by the number of steps in the steps variable
* change the color of the sprite by a small amount
* stamp!
* turn by the number of degrees in the turn variable
* increase the number of steps by 0.5 (so that the next dot you draw will be a little further out than the last).

Extra Credit!

How would you make the shape tighter? Looser?

Which values of turn make straight lines instead of spirals?

. . .

That’s it!

Return to the Drawing Page | Return to the Home Page