Sunday, August 5, 2012

Lesson 1 - Sprite control, Command, Motion, Pen Blocks




Objectives:
• Learners will become familiar with the layout of the Scratch project screen.
• Learners can describe a SPRITE as a 2-dimensional object that can be manipulated.
• Learners will understand how to piece together code blocks to build basic programs.
• Learners will use command and motion blocks to move a sprite on the screen.
• Learners will use command and pen blocks to draw shapes on the screen.

GETTING READY
1. Open Scratch.
2. Review the areas of the project screen.
3. Click on the Stage icon.
4. Click the Backgrounds tab.
5. Click the Import button.
6. Select the xy-grid.
7. Click the OK button.

MOVING THE SPRITE
8. Click the Sprite 1 icon in the sprite area.
9. Click and hold the Scratchy (cat) sprite in the stage; drag him around.
10. Click the Motion button in the Palette.
11. Click and drag the  “go to x: _ y: _” button onto the script area.
12. Click the white boxes and fill them in with 0 and 125.
13. Double-click the box and Scratchy will jump to that point on the xy-grid.

14. Click the Control button in the Palette.
15. Click and drag the “wait _ secs” block onto the script area.
16. Click the white box and change it to 0.1.
17. Click and drag the “wait” block until it connects beneath the “go to” block.

18. In the Sprite Toolbar, click the duplicate button.
19. Click the stamp tool onto the two blocks to make a copy, and then click the script area below to paste the copy.
20. Repeat this until you have 5 copies total. This is a little tricky, so take your time.
21. Change the XY coordinates in the boxes to the coordinates listed in the box to the right.
22. From the Control scripts, click and drag the “forever” block onto your script block. Notice how it wraps around the entire set of blocks.
23. Click and drag the “when clicked” block above the “forever” block.
24. In the stage area, click the green flag. Click the red dot to stop.

What shape is Scratchy making? What shape has 5 corners?

MOTION CONTROL
Scratchy moves a little too fast. Let’s slow him down with the “glide” command.

25. Click the Motion button in the Palette.
26. Drag the “glide __ to x:_ y:_” block below the last “wait” block.
27. Repeat 4 more times so that there are 5 “glide” blocks together.
28. Insert the xy-coordinates into the “glide” blocks using the box to the right.
29. Click the green flag to see what shape Scratchy is making now.

DRAWING THE SHAPE
30. Click the Pen button in the Palette.
31. Drag the “clear” block above the “forever” block.
32. Drag the “set pen color to _” block below the “clear” block.
33. Drag the “set pen size to _” block below that.
34. Drag the “pen down” block below that.
35. Click the green flag to see what happens.

TIME TO DEBUG!
You want Scratchy to always start at the same place before
the drawing begins. How might you do this?

36. Click the Motion button in the Palette.
37. Drag the “go to x:_ y:_” block above the “clear” block.
38. Set the coordinates to your starting point: 0, 125.
39. Click the green flag to see what happens. Did it fix the bug?

CHANGING THE PEN COLOR
40. Drag a new “when clicked” control block below your script.
41. Drag a new “forever” control block under it.
42. Drag the “Change pen color by _” pen block into the “forever” block.
43. Click the green flag to see what happens.

44. SAVE YOUR PROGRAM!

  Save it to your Computer Club folder.

Challenge Yourself!

• Clear this program. Try to create a new motion path for Scratchy that has a different shape, like a rectangle or a square.
• Do you think you can apply sounds to each time scratchy arrives at the starting point, or at a corner on your shape?


The Scratch Project Screen



 

No comments:

Post a Comment