Today you are coding in Scratch. You will build a Racing Car at your device, step by step.
You can already add sprites and run a project with the green flag. Today the focus is on testing as you go and fixing bugs with a clear routine when something does not work.
Before you run anything new, think: what should the car do when it is on the track, and what should change on the grass?
Keep the start short so time stays on the build. Confirm everyone is in Scratch and ready. Optional predict: before anyone runs new behaviour, ask what should happen when the car is on the track versus on the grass, and park one or two answers to revisit in make sense. Frame the lesson around testing and the named debugging routine rather than a long demo.
Create a new Scratch project and delete the cat sprite.
Model creating a new project and deleting the cat on the board. This delete step is routine in Scratch whenever the default sprite is not needed. Watch for students editing a shared or old project by mistake; they should be in a fresh project.
Included with this step is a red car picture that we're going to upload into our Scratch project. First download the picture file onto your computer and then upload it into your project.
To download a picture to your computer, right click on the picture and then click on 'Save image as...'
Talk through download then upload of the car image if the network is strict. Circulate to catch failed uploads or students drawing a car instead of using the provided picture. Differentiation: support anyone stuck on save-image or upload before the class moves on.
As the car sprite is very large, we'll need to shrink it so that it has room to move around. We're going to shrink it to 10% of it's original size. Add the following code to the car sprite.
when green flag clicked
set size to (10) %
Click on the green flag and the car will shrink to a smaller size.
Model adding the green-flag hat and set size on the car, then run once so everyone sees the shrink. Common bug: size block on the wrong sprite or still at 100 percent so the car covers the stage. Ask: what size do you expect after the green flag?
We're going to use the backdrop editor to draw a racing track. To open the backdrop editor do the following:
Next we're going to draw a race track. First we will colour the background green and then we will draw a black track. Follow these steps:
Guide the backdrop editor path slowly: stage selected, Backdrops tab, bitmap, green fill, then black track. Emphasise a clear dark track on green grass so colour sensing will work later. Common mistake: staying in vector mode or filling the track the same colour as the grass. Support: allow a simple oval or rectangle track rather than a complex shape.
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.