Abstract
Do you enjoy watching cartoons and animated movies? Do you have fun playing video games? What do all of these things have in common? Fantastic computer animation, that's what! It's a cool job to take an interesting story or game and make it more entertaining by animating it. In this computer science project, you won't animate a full-length feature movie, but you will animate a pinwheel—a project that can go a long way toward creating your own longer animations! You will create an animated pinwheel that can spin as a result of a push of a button. How? Not by magic, but by writing a simple computer program. Don't worry, even if you've never programmed before, this pinwheel animation magic is within your reach. Sound interesting? Then read this science project and get started!Summary
Michelle Maranowski, PhD, Science Buddies
Objective
In this computer science project, you will create a pinwheel animation in Scratch that will spin as a response to user input.
Introduction
It's fun to enjoy a nice day at the park. There might be just enough breeze to fly a kite and enough space to run with a pinwheel and watch it spin with each step. You already know that a pinwheel needs wind in order to spin, even if it is just someone blowing on it. But what if you could make a pinwheel spin without wind, and instead, by pushing a button or adjusting a slider? That would be different and interesting! But how can you do this? Well, you can write a computer program that will make a pinwheel appear on your computer screen and spin when you push a button or provide some other kind of user input. You might be asking, what is a computer program and what is user input? How do you put together a computer program? Let's start with some quick definitions.
Figure 1. This girl is having fun blowing on and spinning a real pinwheel—something you can do, too, on the computer screen! (istock.com, 2010.)
A computer program is a set of algorithms (instructions) that tell a computer exactly what to do. What can you use to put together such a set of instructions? One way you can put together a computer program is in Scratch, an easy-to-learn programming environment for your computer. Scratch is easy to use, so even if you've never written a program before, you'll be able to use Scratch! Plus, Science Buddies has put together a lot of help resources, including the Procedure of this project, to help you get started. You can write all kinds of programs in Scratch, including animations, stories, and games. Scratch offers the user (in this case, you!) many different types of instructions, called blocks, which you can snap together. All you have to do is to drag and drop the blocks that you need into the editing window and you can create something amazing!
Scratch offers all kinds of instruction blocks—blocks to change the appearance of objects on the screen, blocks that can make objects on the screen move, and even blocks that ask for user input. Wait, what is user input? User input is information that the user (the person using the computer) shares with the computer program, like pushing a button or talking into a microphone. The computer program then uses the user input to run the tasks in the program. Even now, as you, the user, read this on the computer monitor, you're giving the computer input. You're probably clicking the mouse or using an arrow key to tell the computer that you want to scroll down the page. The computer program, in this case your Internet browser, responds to that input by moving to the next part of the webpage.
Figure 2. Example of a code block in Scratch. This block spins the pinwheel whenever the user presses the spacebar.
In this computer science project, you will build an interactive pinwheel animation using Scratch. The beauty of computer programming is that it allows you to create just about anything you can imagine, and this science project is a great way to get started. You can create a very cool computer science project, while having lots of fun!
Terms and Concepts
- Computer program
- Algorithm
- Scratch
- User input
- Sensor
- Computer science
- Flow chart
Questions
- What is computer science? Is computer science all about programming?
- Can you describe examples in your home or at school where you see computer science demonstrated?
- What are some areas of study within the computer science field?
- Can you write out an algorithm for an everyday activity, like doing the laundry or making a sandwich?
Bibliography
This resource will introduce you to Scratch:
- Raspberry Pi Foundation (n.d.). Getting started with Scratch. Retrieved December 4, 2023.
Materials and Equipment
- Computer with an Internet connection
Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at scibuddy@sciencebuddies.org.
Experimental Procedure
Getting Started with Scratch
- The first thing you should do is sign into Scratch. If you do not have an account yet, click on 'Sign Up' to create an account.
- If this is your first time using Scratch or if you need a refresher, read the Getting Started with Scratch guide from the Raspberry Pi foundation.
Programming Your Pinwheel Animation
- In this computer science project, you will create a pinwheel animation in Scratch that will spin as a response to user input.
- Once you feel comfortable in the Scratch programming environment, it is time to start the project. As noted at the beginning of the procedure, this science project follows the engineering design process.
- Define a need. In this case, you'll create a fun, interactive pinwheel. But you should first think about things like who is going to play with it and what colors might they like. First, define who your audience is and what features in a pinwheel they would like to see.
- Develop the project requirements. Before you start programming, you'll need to make a decision about what the pinwheel will look like and what the user will do to make it spin. Write down all your decisions.
-
Establish design criteria. Once you have settled upon the project requirements, you need to get down to the business of developing the specific details. These details are called the design criteria. Having a good set of design criteria will help you focus your efforts. The following is a set of questions to help you think about your design criteria. Note that it is not a complete list. You can either use this list of questions to develop your design requirements, or you can develop your own.
- How long will the pinwheel spin when the input is given?
- How many sprites will you use in the animation? From where will you get the sprites and how will they look? For example, will the pinwheel have three wings or four wings? Will you take a digital picture and then upload the image into Scratch or draw your own pinwheel using the paint feature in Scratch?
- Will you provide an instructions background sometime during the animation so that the viewer will know how to make the pinwheel spin?
- How many backgrounds do you plan to use in the course of the animation? Will you take a digital picture and then upload the image into Scratch?
- Would you like to use music in your animation? Will the animation be associated with a background or a sprite?
- How many different categories of blocks do you want to attempt to use?
- Try to use at least two blocks from the Control category.
- What kind of motion do you want the pinwheel sprite to make once it receives input? How long should the pinwheel sprite move once it has received input from the user? In which direction will it move?
- Create and analyze designs. Keeping your design criteria in mind, make a rough sketch, flow chart, or plan of what your pinwheel animation will look like and what the sprites do and/or say. A flow chart is a diagram of boxes where each box represents a step in the program you wrote.
- Build and test a sample program. Once you have created a set of design criteria, it is time to open up Scratch and start working on a sample program. Build your pinwheel sprite and have it do something interesting. Remember to review your design criteria as you work so that you keep yourself focused on the task.
-
Program your pinwheel animation. Keep testing the animation as you work. When you feel that you have accomplished a certain design criteria or task, run the animation and test it out.
- Break the task up into smaller tasks. For example, the first task to accomplish is to get a pinwheel to appear on the screen. The second task is to decide which blocks to use to start the pinwheel spinning.
- It is a good idea to test along the way so that you can iron out small issues as they crop up. You don't want to have a long program at the end that doesn't work and you don't know why.
- If you don't like what you see, then rearrange the instruction blocks into a configuration that you believe will work better.
- Once you have finished your animation, check to see that all of the requirements that you set at the beginning of the project have been met.
- Test and redesign. Test your animation on your friends and family and sit back and watch the fun! How did they like it? Can you use their feedback to improve your animation? Read the Science Buddies Troubleshooting a Program in Scratch if you need help with your program.
The Final Product: Presenting Your Animation
- Once you have finished the final version of your animation and you are happy with it, it is time to show it to your friends and family again.
- When presenting your animation work at your science fair, try to bring in a computer with internet access. If you are not able to do so, take many screenshots of your work, print them out, and mount them on a poster board.
-
Your science fair presentation should also include:
- The requirements list and the design criteria that guided your animation.
- A flow chart of how your animation program works.
- An explanation of what you learned from your research and from doing the animation.
Ask an Expert
Global Connections
The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.
Variations
- Try to use as many sensors from the PicoBoard as possible in your animation.
- Try creating a story around the pinwheel, using different backgrounds, other sprites, and text. Can the audience use the pinwheel input to affect the outcome of the story?
- Tired of pinwheels? Apply the same principles to making an interactive animation of another object that interests you. Hint: When creating your design criteria, think carefully about what the object does and how people normally interact with it.
Careers
If you like this project, you might enjoy exploring these related careers:
Related Links
- Science Fair Project Guide
- Other Ideas Like This
- Computer Science Project Ideas
- My Favorites
- Scratch User Guide