Related Links

  • Science Fair Project Guide

Project Summary

Difficulty  5 
Time required Average (about one week)
Prerequisites You should have access to a computer with the Internet and room for the Scratch program. Scratch can be downloaded for either Windows (2000 or later) or Mac (OSX 10.4 or later).
Material Availability Readily available
Cost Very Low (under $20)
Safety No issues


Share this Project Idea!


Facebook Twitter Delicious Digg MySpace |More Services


Donate to Science Buddies

Sponsor

Sponsored by a generous grant from Symantec Corporation

Internet Safety Tips
Get educated about online safety
with help from Symantec.
symantec.com/norton/familyresources

Abstract

A singing monkey? An elderly couple doing the chicken dance? What kind of funny electronic cards do you like to email people? Feel free to dream up your coolest and funniest card ideas, because in this science project, you'll create your own animated greeting card with a simple-to-use programming language called Scratch. Scratch is a programming language that makes it easy to create interactive stories, games, music, and art. When the program you have written is complete, you can even share it online!

Objective

Use the Scratch programming language to make an interactive greeting card.

Introduction

Who doesn't like to get a greeting card? Getting a card lets you know that someone took time out of their day to think of you. But more and more these days, people are sending and receiving electronic greeting cards. These "e-cards" have the advantage of being easy to send, quickly received (now it doesn't matter if I don't remember my grandmother's birthday until the day of!), and more fun because of their interactive nature.

Figure 1. Example of a greeting card made with Scratch. The pictures (called sprites) can be made to move, spin, change size, and even allow for viewer interaction. To activate the sprites in this greeting card, follow these steps:
  1. Type "yes" in the text box, then click the blue checkmark. This will make the girl jump.
  2. Next press the space bar on your computer to spin the hat.
  3. Then click on the candle picture to make it shrink and grow.
  4. You can click the green flag to make all of the actions happen at once.
  5. If the sprites aren't cooperating, try reloading the card here
Note: Java plugin is required to run this Scratch sample. For information about Java Downloads, visit www.java.com.

The recipient gets to interact with the card by clicking on it, answering a question, or pressing buttons, and the interaction usually triggers an animation. But what is an electronic card, and how does it work? The electronic greeting card is actually a computer program. Any time you are using a computer, you are interacting with a computer program. The program tells the computer what to do. When you type something with a keyboard, for example, computer programs translate the sequence of keys you hit into a list of letters on the screen. Other programs allow you to upload pictures and send them to friends online. In this computer science project, you won't just use programs written by someone else, you will write your own interactive computer program with an easy-to-use program called Scratch. While advanced computer programming languages often involve typing in many lines of code, with complex instructions, Scratch is built for beginning programmers and has lots of easy-to-understand blocks of code that you snap together to give the computer its instructions. Plus, it's fun and gives you the power to create almost anything you can dream up!

In Scratch, coding (creating the program) is done with graphical blocks called scripts. A script is a set of instructions that controls the action that occurs on the computer. You can write computer code by snapping together blocks, much like building bricks or pieces of a puzzle. The blocks are designed to fit only in ways that make sense. This eliminates the annoying error messages that can cause frustration when learning to write computer programs. To create a program in Scratch, you just drag and drop the blocks to make something happen to an object on the screen. Scratch is great for beginners, but still provides a complex environment that also allows you to design more complicated projects. This is the ideal combination for getting started in programming, while still providing a challenging environment for Scratch experts.

In this computer science project, you will get to make your own animated greeting card. You will decide what the card will say and which pictures you want to add. In Scratch, the pictures are called sprites. You will write scripts to make your sprites do all sorts of things. For example, you could write scripts that make a character jump, a hat spin, or a word rock back-and-forth. Once you get started with programming, you'll find there are limitless possibilities for what you can do.

Terms, Concepts and Questions to Start Background Research

Questions

Bibliography

These resources will introduce you to Scratch:

For more information about electronic cards, visit:

Materials and Equipment


Note: This programming science project is best described by the engineering design process, as opposed to the scientific method. You might want to ask your teacher whether it's acceptable to follow the engineering design process for your project before you begin. You can learn more about the engineering design process on the Science Buddies Engineering & Programming Project Tips page.


Experimental Procedure

Getting Started with Scratch

  1. The first thing you should do is download the Scratch program from scratch.mit.edu. If you need help installing it, read the Science Buddies Installing & Getting Started with Scratch page. This short guide will familiarize you with Scratch.
  2. If this is your first time using Scratch or if you need a refresher, read the Science Buddies Scratch User Guide.

Making and Sharing Your Greeting Card

  1. Define a need. Decide on the occasion and for whom you're making the card.
  2. Do background research. Figure out what kind of pictures, animations, and interactions in the card will be enjoyable to the recipient.
  3. Establish design criteria. Decide what your card will contain. The card can be as detailed and action-packed as you want, but there are a few basic elements it must have to make it a strong science project:
    1. A title, such as "Happy Birthday," "Happy Valentine's Day", etc.
    2. One or more pictures.
      1. The images (and text) in Scratch programs are called sprites.
      2. You can make sprites using the Scratch editor or you can import them (meaning bring them in from another file folder within Scratch or from your computer).
      3. See below for details about making new sprites.
    3. Scripts that "animate" the text and pictures. See Figures 2–6, below, for examples of scripts you could adapt for your greeting card.
      1. Scripts are the instructions that control your sprites.
      2. They can make a sprite spin, bounce, change color, appear and disappear, and do just about anything else you can imagine. The examples below show a few scripts you could adapt for your card, but there are many more you can create yourself!
      3. Since you're making an interactive card, at least one of the scripts should include a way for the recipient to trigger an action.


Figure 2.This script makes the sprite to which it is attached spin when the green flag is clicked. In this case, the sprite will spin 15 degrees counterclockwise a total of 50 times and then stop. Computer Science fair project Scratch script makes the sprite to which it is attached spin. IMG 2


Figure 3. In this script, the sprite spins when the spacebar is pushed. This is similar to the script above, but uses the space bar, rather than the green flag, to activate the script. Computer Science fair project Scratch script the sprite spins when the spacebar is pushed. IMG 3


Figure 4. This script will make the sprite to which this is attached grow and shrink rapidly five times, like a beating heart. Computer Science fair project Scratch script will make the sprite to which this is attached grow and shrink. IMG 4


Figure 5. This is a script example that makes the sprite rock back and forth. Computer Science fair project Scratch script example that makes the sprite rock back and forth. IMG 5


Figure 6. This script makes the sprite 1) ask a question, 2) wait for an answer, 3) change its look ("costume") repeatedly if the answer is "yes." In this case, the "costumes" are two pictures of a girl—once while she's in the air and once while she's on the ground. When the pictures are shown alternately, this script makes the girl appear to be jumping up and down. Computer Science fair project Scratch script makes the girl appear to be jumping up and down. IMG 6


  1. Prepare preliminary designs. Now it's time to put all the pieces together and figure out exactly how the Scratch card will look! Start by making some simple sketches on paper of what you want the card to look like (don't worry if you aren't an artist—stick figure art is fine!).
  2. Build and test a prototype. Once you've made your preliminary designs on paper, you're ready to start programming the card.
  3. Start by adding some pictures and text (sprites) to your card. There are several ways to add sprites (see Figure 7):
    1. You can use the Scratch editor to paint a new picture or add text by clicking on the image of a star with a paintbrush next to the words "New sprite."
    2. You can import pictures into the Scratch program from your computer or a file within Scratch by clicking on the image of a star with a folder next to the words "New sprite."
    3. You can have the Scratch program pick a random sprite for you by clicking on the image of a star with a question mark next to the words "New sprite."


    Computer Science fair project Scratch New sprites.
    Figure 7. New sprites. There are three buttons for new sprites. From left to right, they are: paint a new sprite, choose a new sprite from file, or get a surprise sprite. If you use the "choose a new sprite from file" button, you can either select from sprites that came with the Scratch program, or import an image you have on your computer.


  4. To add a sprite, click on one of the "New Sprite" buttons. It's a good idea to give each sprite a descriptive name. See Figure 8, below, for directions on where to enter sprite names.


  5. Computer Science fair project Scratch Costume sprites.
    Figure 8. Click on Costumes to edit your sprites. You can name them using the text box, shown here with the red circle around it.


  6. Add scripts that make your sprites move, ask questions, etc. according to your sketches and designs.
  7. Periodically run your card to see if your scripts are behaving the way you intended. If they aren't, you'll have to figure out why. See the Troubleshooting section, below, for more advice.
  8. Redesign and retest as necessary. Read the Science Buddies Troubleshooting a Program in Scratch page if you need help with your program. Also, take time to evaluate if you like how it all looks. Does it get across the message you wanted? If you aren’t happy with it, feel free to go back to step 4 and try again.
  9. Present the results. Once you have made your card, you can share it. If the recipient is there with you, you can run the card on the computer for him or her.
  10. If they're far away, you can either:
    1. Email them the Scratch program file that you saved your card in, as well as the link for downloading Scratch, or
    2. Upload the card to the Scratch website and email your recipient the URL (web address) for your finished project.
      1. For more instructions on uploading a project to the Scratch website, visit MIT's Getting Started on The Scratch Website page.

Preparing Your Science Presentation

For general advice on engineering presentations, see the Science Buddies page Engineering and Programming Project Tips.

  1. Consider including the following in your presentation:
    1. A goal. For example, to "write an interactive computer program that can be shared online."
      1. Include the theme of your card in the goal section.
    2. A list of requirements. These are the things your program must do.
    3. A description of Scratch.
    4. Scripts you wrote, with a description of what they do and how they work.
      1. Include original scripts that you created.
    5. A laptop with your program loaded and ready to run. If you are not able to bring a computer to your presentation, take several screenshots of your programming instructions and greeting card and print them out.

Variations

Credits

David B. Whyte, PhD, Science Buddies


Last edit date: 2010-03-31 12:00:00


Career Focus

If you like this project, you might enjoy exploring careers in Computer Science.

Computer Programmer
Computers are essential tools in the modern world, handling everything from traffic control, car welding, movie animation, shipping, aircraft design, and social networking to book publishing, business management, music mixing, health care, agriculture, and online shopping. Computer programmers are the people who write the instructions that tell computers what to do.
  Computer Software Engineer
Are you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer.

Multimedia Artist or Animator
If you've ever watched a cartoon, played a video game, or seen an animated movie, you've seen the work of multimedia artists and animators. People in these careers use computers to create the series of pictures that form the animated images or special effects seen in movies, television programs, and computer games.
 



Join Science Buddies

Become a Science Buddies member! It's free! As a member you will be the first to receive our new and innovative project ideas, news about upcoming science competitions, science fair tips, and information on other science related initiatives.


Support Science Buddies

If this website has helped you, won't you consider a small gift so we may continue developing resources to help teachers and students?

 



 


It's free! As a member you will be the first to receive our new and innovative project ideas, news
about upcoming science competitions, science fair tips, and information on other science related initiatives.

Science Fair Project Home      Our Sponsors      Partners      About Us      Volunteer      Donate      Contact Us      Research Grants & Outreach      Site Map

Science Fair Project Ideas      Science Fair Project Guide      Ask an Expert      Blog      Teacher Resources      Parent Resources      Student Resources      Science Careers      Join Science Buddies     


Privacy Policy Science Buddies

Copyright © 2002-2010 Science Buddies. All rights reserved.
Reproduction of material from this website without written permission is strictly prohibited.
Use of this site constitutes acceptance of our Terms and Conditions of Fair Use.