Scratch
Beginner
40 mins
Teacher/Student led
+130 XP

Studio: Red V Green V Blue

Students build a Scratch infection-race simulation with clones and a count variable, then predict and test which colour wins and why the result differs each run.

Teacher Class Feed

Load previous activity

    1 - Start: What We're Building ~4 mins

    Illustration for Start: what we're buildingYou 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.

    2 - Create a New Scratch Project ~3 mins

    Create a new Scratch project and delete the cat sprite

    3 - Create a Red Dot Sprite ~5 mins

    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:

    1. Choose a red colour in the Fill tool
    2. Turn off the Outline tool
    3. Select the Circle tool
    4. Draw a small circle in the middle of the editor (hold down the shift key while you draw it to make it a perfect circle)
    5. Name this costume 'red'


    If for some reason you can't create the red dot sprite, you can just use this starter project which already has the backdrop added to it. https://scratch.mit.edu/projects/780048995

    4 - Create the Green and Blue Costumes ~2 mins

    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'!


    5 - Create a 'Count' Variable ~2 mins

    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]

    123learn · Online learning platform

    Unlock the full learning experience

    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.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. Unauthorised use, copying or distribution is not allowed.

    Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more