Create a new Scratch project and delete the cat sprite.
Go to the Scratch website using the link below and click on the 'Create' link in the blue bar at the top.
By default, each new project starts with the cat sprite already added. To delete the cat click on the x in the blue circle beside the cat in the sprite list.
In this lesson we are going to program a set of traffic lights to display the lights in the right order.
There is a traffic lights sprite file included with this step called "traffic lights.sprite3". Download it to your computer by right clicking on it and clicking "Save Link As...". Then once you've saved it to your computer, upload it into your Scratch project.
You can upload images and sprite files into your project. To upload a sprite follow these steps:
The new sprite will upload into your project and appear in the stage area.
We are going to program the traffic lights to show the lights in a sequence. In coding, a 'sequence' is the order in which instructions happen. For example if you were programming a robot to put on her shoe, the sequence would be:
For our traffic lights we are going to program them to go through this sequence:
The traffic lights sprite has 3 costumes, a red costume, an orange costume and a green costume.
Let's program the traffic light to show the red light for 5 seconds. Add the following code to the traffic light sprite.
when green flag clicked
switch costume to (red v)
wait (5) seconds
Now let's program the traffic light to show the green light for 10 seconds after the red light is finished. Add the following code blocks to the traffic light sprite.
when green flag clicked
switch costume to (red v)
wait (5) seconds // add them under here
switch costume to (green v)
wait (10) seconds
Click on the green flag and check that it works.