How to Get Started with Coding on Your Raspberry Pi with Scratch

By Richard Wentk

You can use your Raspberry Pi to make games and play with real code. It’s called Scratch, and it’s a lot of fun. Scratch is the simplest way ever to make your own software by creating computer code. Usually when you write code, you type words that look a bit — but not much — like English.

Scratch was made for kids, but adults can use it, too. Scratch is a really good way to get started with coding before moving to more complicated computer languages like Python.

You can start Scratch only when the Pi’s desktop is open. Here’s what you need to do:

  1. If you’ve just booted your Pi and you’re at the command prompt, type startx and press Enter.

    The following figure shows you where to find Scratch.

    image0.jpg

  2. When the desktop appears, click the Menu button at the top left of the screen.

  3. Move the mouse down to Programming.

  4. When the next menu slides out, move the mouse to Scratch and click on the Scratch item.

    After a while, the Scratch window appears.

    You may not see the same options on your Pi, or they may be in different places. Look for the words Programming and Scratch in the menu system to find them.

The Scratch window looks like it has a lot going on, but it’s not as complicated as it looks.

From left to right, look for four boxes:

  • Block box: This box has a list of all the blocks you can use. Blocks come in different colors, and the box shows only one color at a time.

  • Scripts/Costumes/Sounds box: This box is where you clip blocks together to make scripts. You can also make new costumes — sprite shapes — and work with sounds by clicking the tags near the top of the box.

  • Stage box: The big white area with the cat is the stage. This box is where you play your game or tell your story.

  • Sprite box: The area under the stage shows all the sprites in your story or game.

When you start Scratch, it makes a sprite for you. The sprite looks like a cartoon cat. You can change the way the sprite looks by changing its costume. You can make it move by changing its position on the stage.