Vidcode: Plastic Pollution PSA
Educator resources
45-70 minutes
JavaScript
The Activity
The goal of this Hour of Code lesson is to increase students' awareness of the problem of plastic pollution, and the growing Great Pacific Garbage Patch. Students will create a project to help promote awareness of the Ocean's plight.
Big Idea: Let's use code to build environmental awareness!
-
CSTA 1B-AP-09 Create programs that use variables to store and modify data.
CSTA 1B-AP-10 Create programs that include sequences, events, loops, and conditionals.
CSTA 1B-AP-15 Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
CSTA 1B-IC-21 Use public domain or creative commons media, and refrain from copying or using material created by others without permission.
CSTA 1B-IC-18 Discuss computing technologies that have changed the world, and express how those technologies influence, and are influenced by, cultural practices.
Lesson Plan
Time: 45-70 minutes
10 minutes background
40 minutes coding
10 minutes sharing
10 minutes reflection
Background (10 minutes)
Code Challenge (40 minutes)
Engage
Show the Gorilla in the Greenhouse animation:
https://www.youtube.com/watch?v=XV0fP4HuFCo
The animation explains how your trash contributes to the Great Pacific Garbage Patch
Explore
Direct students to the tutorial. They should go through the instructions in pairs using the sample images.
Extensions
Invite students to complete the tutorial again with their own images. Search for Creative Commons licensed images using the "Usage Rights" option in Google Images, or use photosforclass.com.
-
// add a cool movie movie = video(); movie.source = "Ocean Turtle.mp4"; tint("green", 20); exposure(20); // think of plastic things that get thrown away var plastic_items = ["🎾", "🎮", "⛱", "📸", "🔫", "🛍", "💿"]; // we need a trash counter to keep track of things var items_counter = 0; // loop through the trash to create a garbage patch while (items_counter <= 20) { var emoji = text(plastic_items[items_counter % plastic_items.length]); emoji.x = Math.random() * movie.width; emoji.y = Math.random() * movie.height; emoji.size = Math.random() * 80; emoji.rotation = Math.random() * 360; items_counter += 1; } // text statement for the Great Pacific Garbage Patch var my_rect = rect(0, 0, movie.width, 70, "green", "clear"); my_rect.opacity = .7; var statement_text = text("The Great Pacific Garbage Patch", 20, 10); statement_text.color = "lime"; statement_text.size = 40; // tag line for the comment - 'end plastic pollution!', make it stand out with a rectangle var my_rect = rect(0, movie.height-70, movie.width, 70, "green", "clear"); my_rect.opacity = .7; var my_text = text("Help End Plastic Pollution Now!", 10, 290); my_text.color = "lime";
Sharing (10 minutes)
Be Prepared to share what you created and share/explain how it worked.
What aspect of the project does each line of code control?
What does a loop do? How do you make one?
What is an array?
What should you do if you're stuck?
Reflection (10 minutes)
What things did other students create that you'd like to know how to do?
What things did you create that you are proud of figuring out?
Does order matter when you're writing code?
What did every project have in common? What was different?
What properties did each team decide to change?
Why is plastic pollution a problem? What can we do to help?
Sign up to our Hour of Code Newsletter for additional resources and updates!