Scratch 1: Sprites, Actions, and Sequences
The purpose of this unit is to understand how computers can be controlled with instructions, organized into what we call scripts or programs.
- In TR 102:
- Find Scratch in
- Put a link to it on the desktop for future convenience.
- Layout of the Scratch window:
- The middle panel is where we create scripts.
- The leftmost panel contains blocks that may be dragged onto the scripts panel.
- The rightmost panel contains the stage and a group of sprites.
- Sprites are "actors" on the Scratch stage.
- Each sprite is associated with an image — in fact, a sprite may have more than one image, allowing it to "change costumes"
All scripts are formed by joining actions (instructions) together, and we have to have some basic actions to begin with. These are called primitive operations.
The primitive operations of Scratch are organized into several groups:
For now, let's explore the Motion group:
- Drag a move block to the Scripts area.
- Click on it to execute.
- Change the number of steps and click again.
- What do the rest of these operations do?
- The simplest script is a single instruction like this.
Combining instructions into sequences
- The next simplest scripts are sequences of actions.
- Drag a move block and a turn block onto the Scripts area.
- Fit them together like Lego (R) blocks.
- Click on the sequence to execute it.
Make a script which has the sprite move each corner (northwest, northeast, southeast, southwest) one after another and then to the center of stage.
- The sprite should face the corner or center it is moving to.
- Glide gracefully.
- Have the sprite "say" something or make a sound at the end of the performance (see the Looks and Sound sections).
Note that you can use other sprites besides, or instead of, the default cat.
- "Paint new sprite" or import one from an image file
- Choose a new sprite from a file.
- Get a surprise sprite!
A sprite can have one or more costumes.
- See the Costumes tab in the middle panel.
- A costume is not necessarily clothing, but just a different image, for example, a different pose which you can use for simple animation.
You can record or import sound files for your sprite.
You can select the stage and choose its backgrounds (similar to costumes) and sounds.