Getting started Starting the Scratch program To start using Scratch go to the web page at scratch.mit.edu. Page 1 When the page loads click on TRY IT OUT. Your Scratch screen should look something like this: Sometimes the Tips or Help bar is showing when Scratch loads, if so you need to close it.
The map below shows the main areas of the screen. Page 2 The Stage is where your programs run, where you will see your scripts come to life. The Blocks Palette is where you find all the coding blocks. You drag these blocks onto the Scripts Area to build your code. The Sprite List shows all the Sprites in your program. You can add new sprites here and select the sprite that you want to write code for. The orange cat is a sprite. It will follow the instructions you create with the coding blocks. There are lots of other sprites to choose from and projects or games can have several sprites. The Backdrop List shows the backdrops (or backgrounds) for the stage. When Scratch starts up there is just a plain white backdrop but you can add others from the built in library or create your own.
Let s start coding Our first task is to create a simple program to make the cat sprite move across the stage. If they are not already showing, click the blue Motion button at the top of the Blocks Palette to show the Motion Blocks. Page 3 Start by clicking on the block and dragging it on the Scripts Area. Now each time you click on the block in the scripts area the cat will move forwards. Notice that you can click and drag a block when it is in the Scripts area and move it around to position it where you want. Also you can click and drag a block back to the Blocks Palette and it will be deleted.the number of steps shown in the white cut out is the number of steps the cat moves. Try changing the number of steps the cat moves to, say, 100.
Click on the block again and the cat moves a greater distance. Coding with Scratch - First Steps How about making the cat go backwards? Try changing the number of steps to -100 (minus 100). You will find that lots of the blocks have these white holes which you can click to change the value. Page 4 Dragging the cat sprite around If a sprite gets to the edge of the stage you can simply click on it and drag it back to the centre of the stage - or indeed any other position on the stage. Joining the blocks The blocks in Scratch are designed to lock together like pieces in a jigsaw so as to create a stack which is known as a script. When the script is run Scratch carries out the instructions block by block starting from the top. Blocks are joined by aligning them and bringing them close together until they automatically snap into place. We will join two blocks to make the cat to do two things move and then say Hello! First switch to the Looks Blocks by clicking the Looks button Click on the block and drag it onto the scripts area.
Page 5 When you click on the pair of blocks the script runs and the cat moves 10 steps and then says Hello!. Note that you can now drag the pair of blocks around the Scripts area as a single unit. If you want to separate the two blocks you need to drag the lower block away. Whenever you have a stack of blocks you can only separate them by dragging blocks away downwards. The Blocks Palette There are 10 colour coded sets of blocks. We use each set to do different things. Click on each colour to see all the individual blocks in that set.
Don t forget You can clear away blocks that you no longer need from the Scripts Area by simply dragging them back into the Blocks Palette. Page 6 Or you can right click on a block or a stack of blocks and select delete. Have a go yourself Dragging and joining blocks is at the heart of programming with Scratch. We will be looking at many of the blocks in other projects but for now it is worth spending some time just playing with the blocks to see what kinds of things you can get the cat to do. You won t break anything! Here are some examples of short programs you could try. For each program build the blocks as shown and then click on the stack of blocks to make the program run. Where there are values inside a block like the 10 in this changing the value just to see what happens. block, try experimenting with
We can make the cat go backwards by making the number of steps negative. So the following two blocks should make the cat go backwards and then forwards. Page 7 But when you click on these two blocks, nothing actually happens! The reason is that the cat moves so fast you cannot see it move, so let s add a yellow Wait block to slow everything down. Now when you click on the stack of blocks you will see the cat move backwards and then forwards.
The exploding cat. Page 8 The disappearing cat In this program we will make the cat disappear and then reappear in a different place. Don t forget If you run a program the cat may end up off the edge of the stage! You can move it back to the centre (or wherever you want) by clicking on the cat and dragging it into place.
Cat and Mouse And finally a simple game of Cat and Mouse. This program makes the Cat sprite follow the movements of your computer mouse around the stage. (Just to be clear, the mouse we are talking about here is the cursor/pointer of your computer mouse not a Scratch sprite!) Page 9 From the blue Motion palette drag a point towards block into the scripts area then click the dropdown menu and select mouse-pointer. Now add a second Motion block to make the sprite move 10 steps. When you click on this pair of blocks the cat sprite will turn to face your mouse pointer wherever it is on the screen and then move a short distance (10 steps) towards the pointer. But it only does this once each time we click the blocks. To make things more interesting we can make the cat continuously follow and move towards the mouse-pointer by repeating the instruction automatically. This is known as a loop and to achieve it we need to use a forever block. Switch to the control palette and drag a block onto the scripts area.
Now drag the forever block so that it encloses the two blue blocks and notice how the jaws of the forever block expand to accommodate the two blue blocks. Page 10 Once you see the white outline of the forever block appear just release your mouse and the blocks will snap into place like pieces of a jigsaw. Now when you click on the stack of three blocks the program will loop continuously and the cat will keep following the movements of your computer mouse. Try changing the number of steps from 10 to 3. This will make the cat move more slowly. If you want to stop the program running click on the red hexagon at the top right of the Stage. Creating a Scratch account and saving your work Make sure you get permission from your parent or carer before you create an account. A Scratch account can be used to save and share your work. To create an account visit scratch.mit.edu and click Join Scratch. You will need an email address and to choose a user name and a password.
Alternatively you can save your work onto your computer. Page 11 Click the File menu at the top left of the screen. Select Download to your computer. And save the file somewhere where you will be able to find it later. When you want to work on your project again, click File and then Upload from your computer. What next? Now you are a coder! Take a look at some of the projects at our website codingformumsanddads.com and explore a lot more of the great things you can do with Scratch.