CS 139 Algorithm Development
Lab01A: Getting started with Scratch
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.
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
Sprite : a small being, human in form, playful and having magical powers
- Enrollment in the class (for Blackboard)
- "About Me" handout (available in PDF)
- Optional: headphones for computer audio
- Optional: worksheet for writing answers
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 Canvas at the end of the lab period.
This lab is adapted from the Scratch Curriculum Guide v20110923, released under the Creative Commons Attribution-ShareAlike license.
Part 1: Hello Scratch!
What are some different ways you interact with computers?
Which of those ways involve you creating something using computers?
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.
When Scratch starts, you will see an application window with several parts:
- In the Linux lab, click the Menu, go to Programming / Scratch
- In the Mac lab, choose Applications / Scratch 1.4 / Scratch.app
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.
- Top: Menu
- Upper-Left: Palettes (Motion, Sound, etc.)
- Left: Blocks (different for each palette)
- Center: Programming area
- Right: Stage (where the action takes place)
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?
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?
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?
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?
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!
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
What are three aspects of yourself that you could represent through images or sound?
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.
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.
- How do you add new images? (e.g., of yourself, hobbies, hometown, etc.)
- How can you make sprites clickable?
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?