String Art

This project creates a piece of string art — a complex geometric shape drawn with only straight lines. (You could arrange pieces of string in the same way.) Watch the movie below to see how the finished project works.

Can you figure out how to make this project? Here are some hints:

Hints

1.
There are two sprites. Each sprite looks like a small, black dot. Both sprites start their scripts in the same way. They:

  • Clear the previous drawing.
  • Raise the pen up.
  • Go to the center of the screen.
  • Set the pen color.

2.
The first sprite now repeats some steps many times. To begin, add a repeat command the first sprite’s script. Try changing the number of repeats until you get the effect you want. (Hint! Start with at least 100 repeats.)

3. 
The first sprite then repeats all of these actions:

  • Puts the pen down.
  • Goes to the center of the screen.
  • Turns by 45 degrees.
  • Moves by the number of steps in a variable named steps.
  • Changes the value of the steps variable by 1 step so that in the next repeat the sprite moves a little further.
  • Broadcasts a message to the second sprite to tell it to move.

4.
In the meantime, the second sprite completes the following actions whenever it receives a message from the first sprite.

  • The second sprite places the pen down.
  • It goes to the first sprite.
  • And it raises the pen.

Just in case it helps, here’s a slow-motion movie that shows how the two pens move. I’ve made the first sprite into a red square and the second sprite into a purple square just for this movie, so that you can see how they’re moving.

. . .

Try changing the turn command to different number values. Watch how the string art changes!

Have fun!


This project is based on http://scratch.mit.edu/projects/domben/770656 by domben at the MIT Scratch web site.