< Course D (2024)

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-10 - Create programs that include sequences, events, loops, and conditionals.
    • 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-AP-16 - Take on varying roles, with teacher guidance, when collaborating with peers during the design, implementation and review stages of program development.
    • 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.
  • Explain how software and hardware work together when programming events.
  • Identify actions that correlate to input events.
  • Share a creative artifact with other students.

Preparation

  • Play through the puzzles to find any potential problem areas for your 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.
  • Hardware - The physical parts of the computer that you can see and touch, like the monitor, the central processing unit (CPU), the keyboard, and the mouse.
  • Software - Instructions that tells the hardware how to do specific tasks.

Teaching Guide

Warm Up (10 minutes)

Introduction

  Display: Show “Reflect” slide

Reflect: When have you caused something to happen because of an action you took? For example, you flipped a switch, the light turned on.

  Display: Show the next slide

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

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

 

Display: Show the next slide

Say: Normally when we hear “event” we think of:

  • Field trip
  • Competition
  • Birthday Party

We’re learning a new meaning for the word "event" today.

Vocabulary

Display: Show “Vocabulary” slide

Say: In Computer Science, events cause other actions to happen.

This lesson has one new and important vocabulary word:

  • Event - An event is an action that causes something to happen.

Main Activity (30 minutes)

Display: Show “Level 8 - Free Play” slide

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)

How Events Happen

Display: Show the “Events in Bounce” slide

Display: Show the “List these events” slide

Have students record the correct order of events shown on this slide. Call on a few students to share their answers before revealing the "Answer" slide.

Display: Show the “Answer” slide

Display: Show the “How do events work?” 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.