What is Scratch?
If you’re looking for a fun, easy way to get started with programming, then Scratch is for you! Scratch makes it easy to create games, interactive stories, art, music and animation. You can even write programs in Scratch that take input from sensors using a device called a PicoBoard. To get some idea of what other people have been doing with Scratch, go to the Scratch home page and browse through the projects that have been shared.
How Do I Get Started?
First, you’ll need to download and install Scratch. From the Scratch Home page click on the “Download Scratch” link:
You’ll then see a list of installer options. Select the installer for your computer’s operating system: Mac OS X, Windows or Linux. This will download the installer program to your computer.
Download and run the installer for your computer. After the installer has finished start Scratch. You should now see the main Scratch window:
A Quick Tour
So what’s all this? A quick overview is in order, but let’s not get too detailed just yet, there’s a lot to discover in Scratch, so we’ll take it slowly.
First up on our tour, on your left, notice the panel with all the notched colored blocks? This is the blocks palette. You’ll be using these blocks to build the scripts that will make your Scratch program run. Clicking on a block category button at the top of the panel controls which blocks are displayed in the bottom panel. In the image below, the motion blocks are displayed.
If you want to learn more about what a block does, right-click on the block and select the “help” menu option. A dialog will be displayed with more information about how to use that block in a script. For example, here is the help dialog that is displayed for the “point in direction” block:
Things to try:
- Click on each of the block category buttons in the top panel to see the other blocks that are available.
- Right-click on a block in the blocks palette and click the “help” menu option to find out more about what a block does.
- Click one of the blocks, for example “move 10 steps”. Does anything happen? Experiment with clicking on the other blocks to see what they do.
The middle of the Scratch window is the scripts area. This is where you will be building the scripts that control your Scratch programs. To build a script you’ll drag blocks from the blocks palette into the scripts area. To remove a block from the scripts area just drag the block back to the blocks palette.
Just above the scripts panel there is a smaller image of the cat that is shown in the window on the right and in the sprite panel in the lower right of the Scratch window. Just to the right of the cat image there is a field with the text “Sprite1” shown, this is the name of the currently selected sprite. Just below the sprite name is the text “x: 0 y: 0 direction: 90”, this tells us where the sprite is located and which direction it is facing. There is only one sprite in our program right now, but if there were more sprites you could change what was displayed here by selecting a different sprite. The scripts that you build will apply to the sprite that is selected.
Things to try:
- Drag a block from the block palette to the scripts area. To remove it drag it back to the block palette.
- Drag the “move 10 steps” and “turn 15 degrees (clockwise)” blocks to the scripts area. What happens when you bring them close together? What happens when you click the blocks? Did you notice any change in the sprite location and direction information?
- Click the text next to the image of the cat and change it from “Sprite1” to “Cat”. Then press Enter or click anywhere else in the Scratch window. Did anything else change?
While we’re in the scripts area, notice that there are two other tabs at the top of the panel: “Costumes” and “Sounds”. Click on the “Costumes” tab, the panel should now appear as below:
We can change the way a sprite looks with costumes. A sprite must have at least one costume, and you can add as many costumes as you like for your sprite.
Things to try:
- Click on the image of the cat named costume1, then click on the image of the cat named costume2. Did anything happen? How do you think we might be able to use the ability to switch between costumes?
- Click the edit button for costume2. The cat picture will be displayed in the Scratch paint editor window. Try to change the cat’s color.
- Select the fill tool.
- Select a color from the color chooser.
- Position the fill tool over the yellow area of the cat and click the mouse. You may need to click on more than one area to completely change the cat’s color. You can click undo if you make a mistake.
- Click the copy button for costume2. What happened? To remove the costume you’ve just created you can click the button.
- Click the import button and browse through the sprites that are provided with the Scratch program.
- If you have a web cam connected to your computer, you can create a costume by taking a picture.
- Click the Camera button to open the Camera dialog:
- Click the button to take a picture. What do you think you could do with this feature?
The last panel in the scripts area is Sounds. Click on the Sounds tab to view the sounds that you can use in your scripts for this sprite.
Things to try:
- Click the button to play the “meow” sound.
- Click the import button to view a selection of sounds that are provided with Scratch. What happens if you click on a sound file? Click OK to add the sound. You can remove the sound after you’ve added it by clicking the button.
- If your computer has a microphone you can record a sound to use in your Scratch program.
- Click the record button to open the Sound Recorder dialog:
- Click the button to start recording.
- Press the button to stop recording.
- Press to listen to the sound you just recorded.
The lower right panel of the Scratch window is the sprite list. Here you’ll find all the sprites for your Scratch program.
You can add a new sprite by clicking one of the three buttons above the sprite list.
Things to try:
- Add a new sprite by clicking the button. This will open up the new sprite selection dialog. Browse through the different sprites available in the Animals, Fantasy, Letters, People, Things and Transportation folders. Select one of the sprites that interests you and click OK. You can remove the sprite by right clicking on it in the sprite list and selecting the delete option.
- Click the to get a surprise sprite. This adds a random sprite from the sprites supplied with the Scratch program.
- Draw your own sprite by clicking the button.
The stage is where all the action in your Scratch program will unfold when you run it.
Just above the stage, in the upper right corner, are two icons: The green flag is used to start a script, and the red octagon is used to stop a script that is running.
Above the start and stop script icons are a set of three icons that change the display size of the stage: From left to right the icons represent small stage, large stage and presentation mode.
To the upper left of the stage are four icons: From left to right these buttons are for duplicating, deleting, growing and shrinking sprites.
Things to try:
- Switch between the small stage, large stage and presentation mode by clicking on the icons in the upper left of the Scratch window. To exit presentation mode you can press Esc or click the back arrow in the upper left of the screen.
- Click the button and then click on the cat sprite shown on the stage. What happens?
- Click the button and then click on the sprite that you just duplicated using the stamp tool.
- Click the button and then click the cat sprite. Can you fill the stage with the sprite? What happens to the image?
- Click the button and then click on the cat sprite. Can you restore the sprite to its original size? What happens when you keep shrinking the sprite?
Now that you’ve had an opportunity to see many of the features that Scratch has to offer, let’s take a look at some examples of Scratch programs. When you install Scratch it comes with lots of extras. We’ve seen some of these already, such as the sounds and sprites that you can import into your project. Scratch also comes with many example programs that you can try out.
Look for the File menu at the top of the Scratch window. Click on File | Open… menu option. The Open Project dialog will be displayed:
Click the Examples button on the left of the dialog, then click “Games”, select the “Fish Chomp” game and click “OK”. The Fish Chomp game will be displayed:
Things to try:
- To play the game, click the green flag at the top right of the window. To stop click the red octagon stop sign.
- Click on each of the sprites in the sprite list and examine the script, costume and sound panels.
- Open another Scratch program from the examples folder.
Whew! That was quite a whirlwind tour of Scratch, and we haven’t even scratched the surface yet! (ugh, sorry…) I hope you can see from this brief introduction that Scratch has a lot to offer. Feel free to experiment with the features that we’ve just covered. We’ll get started in the next tutorial with creating a simple script using some of what we’ve just explored.