Scratch Snowflakes

This post was prompted by @clcsimon’s
Festive Computing & Coding Activities and @MissPhilbin’s How to make Snowflakes with Code.

However, we have just completed two lessons with Year 7s drawing polygons and (Barefoot Computing’s) crystal flowers.  I therefore wanted a scratch version of snowflakes – and also code that did a 6 pointed snowflake too.

The basics of @MissPhilbin’s python example is the following:

  1. make 3 ‘sticks’ of distance 30 at 45 degree angles
  2. make 3 twigs going back 30 each time
  3. repeat branch 7 times at 45 degrees (I will need 5 times and 60 degrees for a 6 sided snowflake).

These are the steps using scratch:

1. Choose Rudolph as your sprite:
You can find him in the fantasy animals section of the sprite library.  You need to select him, make him smaller, then move the rotation cross so its still in his middle…

2.  Make the twig (I’ve moved Rudolph to the side so you can see the drawing):

3.  Make the branch (Come on Rudolph, move over…):

4.  Make the Snowflake :
Now you’ve made the branch, you can define it as a function (purple) called Branch, and use it whenever you want:

The example actually shows a snowflake 3 times larger (moving 90).

The pen colour varies with up to 200 hues, so changing the pen colour by 30 each time gives a good spread of colours.

5. Extension:
With a small snowflake (30) try making it snow in planned, then random, places on the screen.

These blocks may help you:

2.0 Go to X () Y ().png and 2.0 Pick Random () to ().png

and remember the size of the Scratch screen: