Learn how to create animations, interactive stories, and games the drag-and-drop way using the computer programming language Scratch. Scratch provides an intuitive interface that makes learning to program fun, easy, and well-suited as an educational tool for our children and students.
We don't need to artificially restrict Scratch to the classroom though it makes a fantastic teaching tool. Anyone with a desire to learn a programming language can use Scratch as an introductory language. Perhaps you've tried other languages, such as Ruby, PHP, Java, or Python and had trouble getting started for one reason or another. Even if you can barely create a presentation using PowerPoint or OpenOffice.org, you'll find comfort in Scratch's building-block approach to programming.
After using Scratch, programming will make sense. It will seem easy. It will bring a smile to your face.
Whether you want to improve your digital literacy skills by learning to program or you want to learn a new tool to help you teach your students, here's to happy Scratchin'.
Scratch is developed by the Lifelong Kindergarten group at the MIT Media Lab. See http://scratch.mit.edu for more information. The Lifelong Kindergarten group at the MIT Media Lab developed Scratch as a teaching language specifically for 8 to 16 year olds, but there's nothing stopping the rest of us from enjoying the Scratch experience and sharpening our 21st century learning skills.
Learning: We do it for life. We should help our children develop skills that will help them keep learning in an increasingly digital environment.
Using Scratch, we learn how to design, think, collaborate, communicate, analyze, and program in a computer language. Many of these ideas incorporate 21st century learning skills. If you'd like more information about 21st century learning skills, visit the Partnership for 21st Century Skills web site at http://www.21stcenturyskills.org.
By the time we make our cat dance for the first time, we'll forget all about the academic research and theories behind Scratch. Instead, we'll be focused on discovering the next idea.
I couldn't begin to suggest every possible way for you to use Scratch; that's why we have an imagination. However, here are a few ideas to get you started.
Use Scratch to teach yourself or your students how to program. That's the obvious one.
Use Scratch to demonstrate math concepts. For example, when it's time to teach variables, set up an interactive game that uses a variable to keep score or moves based on the variable data. Scratch can also demonstrate the X and Y coordinate system.
Inspire your kids to read and write. Find a story and animate each scene, or encourage them to animate the story. Turn their persuasive essays into a Scratch project.
Have a child who only wants to play video games? Make a deal. Your child can play only the games he or she creates with Scratch.
I'm sure you've got a lot of ideas flowing in your mind by now. Keep writing them down no matter how hard, easy, obvious, or silly they seem to be. The next one might be your best idea yet.
With Scratch, we'll learn how to turn our imaginations into games, stories, and animations, and in the process, we'll learn some common programming concepts. If you're already a knowledgeable programmer, then you'll find out what Scratch has to offer your students.
The Scratch team publishes several resources to help educators, including a Programming Concepts guide, which I've summarized below:
As of Scratch version 1.4, there are a few limitations with the language. As taken from Scratch's Programming Concepts guide, here are the concepts Scratch does not cover: functions, recursion, exception handling, file input/output, inheritance, parameter and return values, and defining classes of objects.
If that last paragraph sounds like gibberish, don't worry about it.
For those of us with a desire to use geek terms, Scratch provides an Integrated Development Environment (IDE) that enables us to design, program, and run our projects. Don't worry; we'll just call it the Scratch interface from this point forward. You can see it in the following screenshot:
In the following chapters, we will become familiar with the parts of the Scratch interface, so we don't need to spend a lot of time reviewing what each button does. Let's instead stick with the big concepts.
If we review the Scratch interface from left to right, everything we need to create a project is readily accessible. To the left side of the interface, we have categories of blocks that are grouped by the kinds of tasks they perform. They are Motion, Looks, Sound, Pen, Control, Sensing, Operators, and Variables.
Throughout the book, I'll refer to these categories of blocks as palettes.
The palette of blocks available to us as Scratch programmers are analogous to the palette of colors an artist mixes when creating a painting. Each type of block is color-coded so that we can easily identify them in our scripts.
When we create our Scratch programs, we build a group of scripts that tell our story. Instead of using words as you're used to reading them on this page, we'll build our scripts from the palette of blocks.
We'll drag, drop, and snap them into place in the Scripts area to create our story. The following screenshot shows a script that was taken from one of the sample projects included with Scratch:
If we read the blocks shown in the screenshot from top to bottom, we should have a good idea of the story this sprite tells. Who doesn't love a knock-knock joke?
To see our story play out, we watch the stage.
When it comes time to review the script, we watch it on the stage. It's here that we get to see our ideas turn into reality.
And just like the stage at the theater, we can see from our screenshot that we can have a cast of characters to entertain us.
Scratch even provides a built-in image editor to help us create and modify our characters, which we call sprites.
Scratch includes a simple image editing environment called the Paint Editor that allows us to apply text, color, and shape to our sprites and backgrounds.
The Paint Editor allows us to do the following:
The Paint Editor is available from multiple points within the Scratch interface, as we'll see later in the book.
The structure of the Scratch interface makes it easy for us to tinker and explore ideas. As we create, we evaluate our work and determine if the results meet our expectations. It's very easy because everything happens in one interface.
We don't have to compile code, switch windows, upload files to a server, or encounter any number of obstacles to see if our code works. Scratch enables us to modify the program as it runs and see the results in real time.
I took a project-based approach in this book. So, instead of working with a single project, each chapter creates something new.
While I may want to tell a story, you may want to create a game, build an animation, or explore an interactive art project. By working with a range of projects, we'll quickly learn and focus on the concepts that matter the most.
The more ideas we generate, the better off we'll be when it comes to helping our children or students learn Scratch. Feel free to adapt the projects in this book to your own needs. Reuse them as needed.
It's true that Scratch will teach us how to program, but it really just provides us a visual framework. We can use this framework to express creative thinking while we learn how to do the following:
Design the project's scenes and interfaces
Analyze behavior and troubleshoot problems
Improve the project through revisions
Share our imagination with our peers through our projects
I expect that after we get started, you'll have your own ideas about a project or a variation on the current exercise. Keep a pen nearby and write those ideas in the margin.
Here's a chapter-by-chapter look at what we'll cover in the book.
You're reading this chapter right now. You'll find out what we can expect from Scratch and how it can help us teach 21st century learning skills.
Scratch is a cross-platform application, which means you can use it on Windows, Macintosh, and Linux operating systems. In this chapter, we'll look at the installation procedure on each operating system and even learn how to run Scratch from your USB flash drive.
We'll also make sure your web browser can view Java applets, which is the technology Scratch uses to publish projects on the Web.
We will explore the Scratch interface and create some simple scripts that demonstrate how easily we can build a project. This is a high-speed tour of Scratch that gets us tinkering and thinking about what's possible.
Sharing is a central philosophy to Scratch. Each project we upload to the community web site will be available under a Creative Commons Attribution-Share Alike license. Since we don't have any work to share, this gives us an idea of where we're heading. We'll demonstrate how to find and download a project to inspire us.
In Chapter 4, we will slow down the pace and talk about the concepts in more detail. We will also create two projects; the first will be an animated birthday card, and the second will be a picture slideshow using our favorite photos.
We'll use the Paint Editor to design images for the project and transform those images with various graphic effects. We'll also learn how to control the sequence of our scenes.
We will develop a barnyard humor book that lets us shine as storytellers. We'll find out how to turn our chapters into scenes using Scratch.
Our sprites will change appearances, speak, make noise, and report to specific stage coordinates. The emphasis will be on how to use these elements to tell their story.
In Chapter 6, we will take a classic pong game that's included with Scratch and give it a little personality. Our Scratch installation comes with a classic looking pong game, so rather than start over, we'll modify it.
The central concepts in this chapter include dynamic interaction and conditional statements to control how our paddle and ball move across the stage. We will also introduce variables as a way to store and retrieve information for use in our programs.
Here, we will visit the fortune-teller and learn the answers to all our deepest questions. It might be more appropriate to say we'll build the fortune-teller game, so we shouldn't really trust our "fortunes."
In Chapter 7, we will combine what we know about variables with lists, also known as arrays. We will use the lists to store information about our fortunes and use random numbers to retrieve the data. Variables store dynamic data that we use to determine how our program should behave.
Chapter 8 proposes the following problem: Would you rather have a dollar today that doubles every day for a set number of days? Or, would you rather have a lump sum of money? We will build the program to answer that question.
This chapter compares the power of doubling versus the accrual of simple interest. We'll make the math problem interactive and allow the user to input custom starting values. Then, we'll show the results in a graphical format using the pen tool.
We're back to sharing. In Chapter 3, we learned how to download a project from the Scratch web site. In Chapter 6, we transformed a Scratch project to meet our own needs. In Chapter 9, we will give back to the Scratch community by making our own project available on the web site for others to enjoy and adapt.
In the process, we'll review the many ways in which we can promote our project to gain fans. For advanced users, we'll incorporate our Scratch projects on our own web server.
We'll add our own personal touch to Scratch in Chapter 10 by connecting a webcam and a PicoBoard to our computer. The PicoBoard is an add-on piece of hardware that connects to our computer and delivers real-world stimuli to Scratch.
If you don't have a PicoBoard, you can still review this chapter to see what kinds of things you can do. Then, you can decide whether or not you want to get one. For example, this chapter gives us an example of how to program gravity that may be useful in your game whether you use a PicoBoard or not.
To demonstrate the board's light, sound, button, slider, and electrical resistance sensors, we will modify existing projects.