What happens if you give a computer clear steps, in order, and press run?
Today you start coding in Scratch. In a couple of minutes you will see where this course is heading: games, a website, micro:bit, Python, and one assessed piece of work at the end: a software project with a small team, or a portfolio of your work. Then you will build your first short program step by step at your device: predict what it might do, add the blocks, run it, and fix anything that does not work. You will also save your project where your teacher has told you to keep your work, and open it again to check it is really there.
Scratch is a coding website that we can use to create our own games, animations and projects.
Watch this short minute video to get a quick introduction to it.
Now let's take a look at the Scratch website!
Open the Scratch website by clicking on the link below. Once it opens up click on the Create link at the top of the page. This will open up the project editor. Once you've done that come back to this tab and move onto the next step.
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.
Every new Scratch project starts with a default sprite, which is a cat. For our project, we want to start with a blank slate, so we will remove this cat sprite.
To do this, look below the stage area where you see a small thumbnail of the cat sprite. In the corner of this thumbnail, there's a small 'x'. Click on this 'x' to remove the cat sprite from your project.
Don't worry about losing the cat sprite. If you ever want it back, you can always find it in the sprite library!
Scratch comes with a sprite library that's packed full of different characters.
Open up the sprite library and add the Bat sprite to your project.
You'll see that it gets added into the stage area and we can now give it some code!
To add a sprite from the sprite library follow these steps:
You can use search box or the filter links (Animals, People, Fantasy etc) to locate your sprite.
Now let's try making the sprite move. Add the following code blocks to the code area by dragging and dropping them. The colour of the blocks lets you know which "block category" to open.
when green flag clicked
move (10) steps
turn cw (15) degrees
You may have noticed the numbers inside the blocks you added. The blocks use these numbers to decide how much to move or to turn.
Change the numbers like below:
when green flag clicked
move (10) steps // change the 10 to 50
turn cw (15) degrees // change the 15 to 25
A loop is something that makes a set of instructions "loop" or repeat a number of times.
We're going to add a loop to our code by doing the following:
when green flag clicked
forever
move (50) steps
turn cw (25) degrees
end
As well as a sprite library, Scratch also has a backdrop library.
Backdrops are images that appear in the background of your stage area. They're great for setting the scene and making your game or animation look better!
Add a backdrop to your project by choosing one from the backdrop library.
To add a backdrop from the backdrop library follow these steps:
You can use search box or the filter links (Fantasy, Music, Sports etc) to locate your backdrop.
Your first Scratch program works. Now find out what else the blocks can do.
Pick one block you have not used yet and add it to your sprite. Good places to look:
Run it, and be ready to say what changed. If it does something you did not expect, pull the new block back out and run it again to check that was the cause. That is debugging, and you will do it in every lesson from here.
Together, look back at what you built:
Nobody gets a program right first time. Being able to say what went wrong, and what you changed, is the skill.
Think about and discuss:
Today you:
Save your project now, using the save routine your teacher put up at the start of the lesson. Then close it and open it again, so you know for certain it is really there next lesson. You will save this way in every lesson from now on.
Every lesson in the course is ready to teach like this one. See what else comes with it, and how to order it.