< Course D (2021)

Lesson 6: Events in Bounce

50 minutes

Overview

In this context-setting/skill-building lesson, students will learn what events are and how programmers use them in video games. Students will build a game that they can customize with different speeds and sounds.

Purpose

Events are very common in computer programs, especially in video games.

In this lesson, students will develop their understanding of events by making a sports-based game. Students will learn to make their paddle move according to arrow keys, and make noises when objects collide. At the very end, they will get to customize their game to make it more unique!

CSTA K-12 Computer Science Standards (2017)
    • 1B-AP-12 - Modify, remix or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.
    • 1B-CS-01 - Describe how internal and external parts of computing devices function to form a system.
    • 1B-CS-02 - Model how computer hardware and software work together as a system to accomplish tasks.

Cross-Curricular Opportunities

Next Generation Science Standards
      • 3-5-ETS1-1 - Define a simple design problem reflecting a need or a want that includes specified criteria for success and constraints on materials, time, or cost.

Agenda

Objectives

Students will be able to:
  • Create an interactive game using sequence and event-handlers.
  • Identify actions that correlate to input events.
  • Share a creative artifact with other students.

Preparation

  • Make sure every student has a reflection journal.
  • Play through the puzzles to find any potential problem areas for your class.
  • Read the *slide deck (to be presented to students at end of class).

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the teachers
For the students

Vocabulary

  • Event - An action that causes something to happen.

Teaching Guide

Warm Up (10 minutes)

Introduction

Say: Let’s see if we can find a pattern here:

  • When you flip a switch, the lights turn on.
  • When you tap on a device, an app starts.
  • When the ball goes in the net, score a point.
  • When (event), (action).

In computer science, events cause other actions to happen. Our new vocabulary word today is event. Normally when we hear “event” we think of:

  • Field trip
  • Competition
  • Birthday Party

We’re learning a new meaning for the word "event" today. Let's focus on "events" that cause other actions to happen like when getting the ball in the goal scores a point or pressing a button to make a character in a game move.

This lesson has one new and important vocabulary word:

Event - Say it with me: E-vent.

An event is an action that causes something to happen.

Main Activity (30 minutes)

Online Puzzles

At the end of the set of puzzles, students will have the opportunity to make their game unique. Have the students try new ways to make the game more challenging. For example, try playing with many balls at once, or each time the ball bounces off a wall, launch more balls.

Teaching Tip

Remind the students to only share their work with their close friends or family. For more information watch or show the class *Pause and Think Online - Video.

Wrap Up (10 minutes)

Reflection

Prompts:

  • What was today’s lesson about?
  • How did you feel during today’s lesson?
  • What did you do to make your game super cool?
  • What kind of game do you want to code in the future?

How Events Happen

Present the *Events in Bounce - How Do They Happen? slide deck to students. Allow them to record the correct order of events on the second slide in their journals first. Call on a few students to share their answers before revealing the third slide. Discuss the correct sequence with the class.

Teaching Tip

Although introduced in this lesson, the slide deck *Events in Bounce - How Do They Happen? can be applied more generally to express the relationship between hardware and software. Particularly, the final slide simplifies the input-to-output sequence and can be made into a poster for your classroom.

Extended Learning

Take Me Out to the Ball Game

Take the students outside to play some sort of ball game. Keep track of events and actions. For example, not dribbling in basketball results in a traveling foul and the other team gets the ball. In soccer, kicking the ball out of bounds results in the other team kicking the ball in. Getting the ball to the goal results in a point! Make up more events if your students are into it. Have all of the students yell "Yippee" when the captain of one team scores a point. Have everyone fall to the ground and roll around if a student makes two goals in a row!

Cross-Curricular Opportunity

Game Day Commentary (45-60 minutes)

Computer Science + English Language Arts + Math + Science

Game Day Commentary is an optional activity aligned to Common Core ELA, Common Core Math and Next Generation Science Standards, written by our teacher community. In this activity, students will read aloud instructions as they learn to code with events in Bounce to make a game. Once the game is complete, students will provide play-by-play commentary as their classmates predict which way the ball will bounce in order to score. Students will also complete a Frayer model about bar graphs prior to creating a scaled bar graph using the data collected during their game.

Standards Addressed:

  • CCSS.ELA-LITERACY.RF.3.4: Read with sufficient accuracy and fluency to support comprehension.

  • CCSS.ELA-LITERACY.SL.3.4: Report on a topic or text, tell a story, or recount an experience with appropriate facts and relevant, descriptive details, speaking clearly at an understandable pace.

  • CCSS.MATH.CONTENT.3.MD.B.3: Draw a scaled picture graph and a scaled bar graph to represent a data set with several categories. Solve one- and two-step "how many more" and "how many less" problems using information presented in scaled bar graphs.

  • NGSS.3-PS2-2: Make observations and/or measurements of an object’s motion to provide evidence that a pattern can be used to predict future motion.

Creative Commons License (CC BY-NC-SA 4.0).

This work is available under a Creative Commons License (CC BY-NC-SA 4.0).

If you are interested in licensing Code.org materials for commercial purposes contact us.