Vidcode: Plastic Pollution PSA

Educator resources

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.

Sample Solutions

vidcode_pollution.jpg

Big Idea

Let's use code to build environmental awareness.

About 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.

Standards

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.

Time: 45-60 minutes

1 hour:

  • 10 minutes Engage

  • 40 minutes Exploring the code

  • 10 minutes Reflection

Code Challenge

Engage 10 minutes
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 40 minutes
Direct students to the tutorial. They should go through the instructions in pairs using the sample images.

Extend
Gather the students back together for a class discussion. Put the sample project (or one of the student projects) on the board.

  • 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

Group reflection questions:

  • 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?

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.

Sample Solution

// 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";