You can already work in Scratch and make sprites appear and move. Today you will build Red v Green v Blue: a race of coloured dots that clone, move and infect each other.
Before you run the finished project, think: which colour do you expect to win, and why might that change if you run it again?
You will predict, build step by step, run, and fix as you go.
Keep this tight. Devices on Scratch, students logged in. Optional predict: before anyone builds far, ask which colour they think will win and why the answer might differ each run. Do not let discussion eat build time. Organise pairs if that is your class routine; circulate once the code-along starts.
Create a new Scratch project and delete the cat sprite
Model Create a new project and deleting the cat on the board. Watch for students editing an old project by mistake. Differentiation: peer help for anyone new to the Scratch home screen.
Create a new sprite by clicking on the paintbrush, this will open up the sprite editor. To draw draw a red circle, follow these steps:
Sprite editor is the bottleneck. Demonstrate fill on, outline off, shift for a perfect circle, and naming the costume red. Have the starter project link ready for anyone stuck. Common bug: outline left on so dots look ringed later.
We now need to create two more costumes for this sprite, a green circle and a blue circle.
Duplicate the red costume twice and then use the paint bucket tool to change the colour to blue and green.
Don't forget to name the costumes 'blue' and 'green'!
Students duplicate the red costume twice and bucket-fill green and blue, naming each costume. Cue experienced students to support peers. Misconception: renaming the sprite instead of the costumes; infection and random costume logic need the costume names exact.
Now that we've created our sprite, let's start coding!
We're going to code 100 dots to appear so we need a variable to let us count to 100. Using the Variables toolbox create a 'count' variable.
Add the following code to your sprite to start 'count' at 0.
when green flag clicked
set [count v] to [0]
Variables toolbox: create count, then set count to 0 on green flag. Ask why we need a counter before making many clones. Watch for Make a list chosen by mistake, or the variable set on the wrong sprite.
You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.