Hardware Reference
In-Depth Information
T
What do you think will happen when you click the green lag? Try it and ind out
if you are correct.
Next, add some more animation to your monkey by having him move as well as change
facial expressions.
8. With the Scripts tab still selected, underneath your irst block add another when
clicked control block.
9. Next add the motion block go to x:0 y:0.
A
The stage area in Scratch uses the coordinates x and y to refer to where your
sprite will appear on the stage. If you want your sprite to begin in the middle of the
stage, use x:0 and y:0 . If you want your sprite to appear in the top left portion of
the stage, use x:-163 and y:11 . Notice that when you select a sprite with your
mouse you can see its coordinates at the top of the Script tab (see Figure 3-12).
Move the sprite with your mouse and watch as the coordinates change to relect
the new position. There is also a handy graph background showing the x and y
axes that you can import from the library to help you.
10. Again, you need to use a forever control block to repeat some instructions.
Inside the forever block, add three blocks from the Motion Blocks palette:
move 10 steps ; turn 15 degrees right ; and if on edge, bounce .
11. Note the three small buttons next to the monkey sprite at the top of the Scripts
tab (see Figure 3-12 for reference). hese control a sprite's rotation. Click the
middle button, which directs the sprite to only face left and right . his
will add more animation to the monkey sprite and allow him to move more than
just his mouth.
Save your animation by clicking File Save As and naming it jungle animation
inside the Scratch Projects folder.
Figure 3-12 shows the completed script. Notice that I have added a third block of com-
mands to include a sound efect for the animation.
Search WWH ::




Custom Search