CS 139 Algorithm Development
Lab01A: Getting started with Scratch
Background
During the next few labs, you will be creating your own interactive computational media with Scratch. The concepts we learn in this environment translate directly to what you will be doing in Java throughout the semester.
Objectives
The students will:
- understand the concept of computational creation, in the context of Scratch
- be able to imagine possibilities for their own Scratch-based computational creation
- become familiar with resources that support their computational creation
- become familiar with a wide range of Scratch blocks
- be able to create a Scratch project that is an interactive digital representation of their interests
Key Terms
Sprite : a small being, human in form, playful and having magical powers
Materials Needed
- Enrollment in the class (for Canvas)
- "About Me" handout (available in PDF)
- Optional: headphones for computer audio
- Optional: worksheet for writing answers
Instructions
Write the answers to the numbered questions in a text file or on a separate sheet of paper.
You may be asked to share your answers with the rest of the class.
Follow the steps below to create a Scratch project and experiment with it.
At the end of Parts 1 and 2, we will ask for volunteers to share what they have learned.
You will submit your Scratch project electronically via Blackboard at the end of the lab period.
References
This lab is adapted from the Scratch Curriculum Guide v20110923, released under the Creative Commons Attribution-ShareAlike license.
Part 1: Hello Scratch!
Step 1.
What are some different ways you interact with computers?
Step 2.
Which of those ways involve you creating something using computers?
Step 3.
Watch the "Intro to Scratch" video at http://vimeo.com/29457909 (about 3 min).
- How would you answer the question "what is Scratch" to a relative or friend? Write 2-3 complete sentences:
Step 4. Using one of the lab computers, open the Scratch application.
- In the Linux lab, click the Menu, go to Programming / Scratch
- In the Mac lab, choose Applications / Scratch 1.4 / Scratch.app
When Scratch starts, you will see an application window with several parts:
- Top: Menu
- Upper-Left: Palettes (Motion, Sound, etc.)
- Left: Blocks (different for each palette)
- Center: Programming area
- Right: Stage (where the action takes place)
Note: In Scratch, there are more than 100 blocks in 8 different categories! We will only learn a subset of them in class, but you should feel free to explore all of them.
Step 5.
To get started, let's make the cat do a dance. Start by dragging out the "move 10 steps" block from the "Motion" blocks palette to the scripting area. Every time you click on the block the cat moves a distance of 10.
- How can you make the cat move backwards?
Step 6.
From the "Sound" palette, drag out the "play drum" block. Click on the block to hear its drum sound. Drag and snap the "play drum" block below the "move" block. When you click on this stack of two blocks, the cat will move and then play the drum sound.
- What happens if you separate the blocks? What does "snapping" blocks do?
Step 7.
Copy this stack of blocks (either using the Duplicate toolbar item or by right-clicking the stack and selecting "duplicate") and snap the copy to the already-placed blocks.
- How can you make the cat move back and forth?
Step 8.
Go to the "Control" blocks palette and grab the "repeat" block. Wrap the "repeat" block around the other blocks in the scripting area. Now when you click on the stack, the cat dances forward and back 10 times.
- How can you make the cat stop dancing?
Step 9.
Finally, drag the "when Sprite clicked" block and snap it to the top of the stack. Click on the cat (instead of the blocks stack) to make the cat dance.
- What else can you make the cat do? Be creative and spend at least 15 minutes. Make something surprising happen to a sprite!
Step 10:
Save your Scratch project in a safe place (e.g., thumb drive, Dropbox, Google Docs). Do not store it on the lab computer; it will be erased when you log out.
- Select File / Save from the top menu, and select an appropriate storage location.
- Fill in the project file name and click OK.
- The file that is created during the Save (*.sb) is the one that you should turn in via Blackboard when you are finished.
Part 2: About Me
Step 11.
What are three aspects of yourself that you could represent through images or sound?
Step 12.
For the rest of the lab, you are to design an interactive collage that represents these aspects. Refer to the "About Me" handout for details.
- How do you add new images? (e.g., of yourself, hobbies, hometown, etc.)
- How can you make sprites clickable?
Tip: Check out the Scratch resource library at http://info.scratch.mit.edu/Support for the official getting started guide, video tutorials, scratch cards, and more.
For other ideas, check out example projects at http://scratch.mit.edu/channel/featured.
Step 13.
Questions to consider when finished:
- What was your inspiration?
- What did you get stuck on? How did you get unstuck?
- What are you most proud of? Why?
- What might you want to do next?