Raspberry Pi A User Manual page 179

Hide thumbs Also See for Raspberry Pi A:
Table of Contents

Advertisement

C H A P T E R 1 1
Ten steps isn't a very large value, so click on the value
should then read
move 30 steps
isn't that interesting, however, so switch to the Sound block palette and drag the
block to the Scripts area and link it beneath the existing
sound meow
the cat in this position for a while, add in a
ette. Without this, the sprite will appear to flick quickly between its starting position and the
target position.
To make it so the program can be run multiple times without the cat sprite disappearing off
the edge of the stage, add another
and modify it to read
move -30 steps
ures like this: if a value of
make it move the exact same distance in the opposite direction.
Finally, add the
when [flag icon] clicked
top of the Script area's stack of blocks to complete the program as shown in Figure 11-5.
Clicking the green flag icon on the top-right of the screen will trigger the program—make
sure you've got speakers or headphones connected to the Pi for the full effect!
A N I N T R O D U C T I O N T O S C R A T C H
. An animation of a cat moving to the right of the stage
wait 1 secs
move 10 steps
. Scratch will happily allow you to use negative fig-
makes the sprite move a certain distance to the right,
30
block from the Control block palette to the
and change it to
10
move
block from the Control block pal-
block beneath the
play sound
. The block
30
play
block. To keep
block
will
-30
Figure 11-5:
The completed
animation
program in
Scratch
163

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Raspberry Pi Raspberry Pi A

This manual is also suitable for:

Raspberry pi b

Table of Contents