A Beginner's Guide to Scratch: Visual Communication for 10th Science

A Beginner's Guide to Scratch: Visual Communication for 10th Science

Understanding Scratch: Visual Programming

10th Science : Chapter 23 : Visual Communication

Introduction to Scratch

‘Scratch’ is a software used to create animations, cartoons and games easily. Scratch, on the other hand, is a visual programming language. It was developed in the Massachusetts Institute of Technology (MIT) Media Lab to make programming easier and more fun to learn.

Scratch Environment Editor

The Scratch editor has three main parts:

They are Stage, Sprite and Script editor.

Stage: Stage is the background appearing when we open the scratch window. The background will most often be white. You can change the background colour as you like.

Sprite: The characters on the background of a Scratch window are known as Sprite. Usually a cat appears as a sprite when the Scratch window is opened. The software provides facilities to make alternations in sprite.

Script editor / costume editor: Where you edit your programs or your sprite’s pictures.

A screenshot of the Scratch interface highlighting the script and costume editor tabs.

You should see a single window with at least the following three panes: the Stage (top left), the Sprite List (bottom left), and the Scripts tab (right), which contains the Blocks tab and the Scripts Area. The right pane also contains two additional tabs, Costumes and Sounds.

The script editor has three main parts:

  • Script area: Where you build scripts.
  • Block menu: Where you choose the category of blocks (programming statements) to use.
  • Block palette: Where you choose the block to use.

When the Costumes tab is chosen, the costume editor is shown (outlined in red):

The Scratch costume editor is shown with editing tools for the sprite.

Movement and Loops

Click File/New to create a new project and enter a project name .

Click the menu Script → Event, drag a when green flag clicked block to the scripts area. Your scripts area should look like this:

Scratch script area with the 'when green flag clicked' block.

Click the menu Script → Motion menu, drag a goto x: 0 y: 0 block to the scripts area and snap it to the bottom of the when green flag clicked block. Your script should look like this:

Scratch script with 'goto x:0 y:0' block attached to the green flag block.

Add a move 10 steps block to the bottom of your script and change the 10 into 100.

Scratch script showing a 'move 100 steps' block added to the sequence.

Click the green flag at the top right corner of the stage to run your program.

Adding Sound

  1. Click Sprite1 in the sprite list and click the Sounds tab.
  2. Try the meow sound already there. If you don’t like it, click the speaker icon to choose a different sound from the sound library.
  3. Click the Scripts tab and find the play sound block from the Sound menu. Add this block to the when space key pressed script. (Select the sound you want from the drop-down list.)
  4. Run your program.

Example: Creating a "Hello" Program with Sound

Here is a complete program to make the sprite say the word “Hello” with sound.

Complete Scratch script for making a sprite say 'Hello' and play a sound.
  1. Click events in script option.

    Highlighting the 'Events' category in the Scratch block menu.
  2. Drag the 'When green flag clicked' block tab to script area.

    Script area showing the 'when green flag clicked' block.
  3. Click Looks in script option. Drag “say” to script area.

    Attaching the 'say' block to the script from the 'Looks' menu.
  4. Type “Hello“ word in say tab.

    Typing 'Hello' into the 'say' block.
  5. Click sounds in script option. Drag play sound to script area. Choose the hello sound from the audio file.

    Adding the 'play sound' block from the 'Sounds' menu to the script.
  6. From File menu choose the Save option.

  7. Click the green flag at the top right corner of the stage window to run the program.

    Location of the green flag icon to run the program in the Scratch interface.

Output

The cat sprite on the stage with a speech bubble saying 'Hello'.