Hardware Reference
In-Depth Information
When completing a Scratch program containing scripts, it is good practice to
save your work at regular points and test that it works. To do this, click File Save
As and then press the appropriate key to start your script. Scratch iles can be
saved into the Scratch Projects folder on your Raspberry Pi. As you move through
the instructions in this chapter, I'll remind you to save your work at end of each
section.
Congratulations, you have written your irst program using Scratch! Of course, you can
do much more with Scratch than just move a cat around the screen. Next, you'll take a
look at the parts of Scratch that you can design yourself—the stage and costumes.
Setting the Stage
If you are creating an animated story or computer game using Scratch, you'll want to
set the scene by changing the background from its plain white default. You can do this
in two ways: by designing and drawing your own background or by selecting an image
from the Scratch library.
To prepare to change the background image, click the Stage icon, which is situated
next to the Sprites palette. Select the Backgrounds tab. You now have a choice between
editing the current background or adding a new one.
To edit the current background, click the Edit button in the Backgrounds tab in
the centre of the screen and the Paint Editor window appears, as shown in Figure
3-5. Use the drawing tools to draw a setting for your animation or game. For
example, you might want to draw a room or a maze.
To add a new background, either click the Paint button to open the Paint Editor
window and create a scene, or click the Import button to use a scene from the
image library (see Figure 3-6).
Scratch also has an option for you to use webcam images as backgrounds for
your Scratch projects. Click the Camera button to access this option. Before you
can use this function you will need to have either a webcam plugged into a USB
port or the Raspberry Pi Cam plugged into the camera slot on the Pi board.
To see a video that walks you through the Scratch interface and shows you
how to create backgrounds and characters, visit the companion website at
www.wiley.com/go/adventuresinrp . Click the Videos tab and select the
QuickHelloFromScratch ile.
Search WWH ::




Custom Search