Lesson 3: Alien Dance Party with Sprite Lab
45 minutes
Overview
Students will use events to make sprites move around the screen based on user input in this skill-building lesson.
Purpose
This lesson offers a great introduction to events in programming and even gives students a chance to show creativity! At the end of the lesson, students will be presented with the opportunity to share their projects.
Standards
AP - Algorithms & Programming
- 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.
Agenda
Objectives
Students will be able to:
- Create an interactive animation using sprites, behaviors, and events.
- Identify actions that correlate to input events.
Preparation
- Play through the puzzles to find any potential problem areas for your class.
- Make sure every student has a reflection journal.
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the students
- Sprite Lab Documentation - Resource
Vocabulary
- Event - An action that causes something to happen.
Teaching Guide
Warm Up (5 minutes)
Introduction
Today students will visit events in programming.
A Series of Events
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 alarm goes off, you get out of bed.
- 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 flipping a switch causes the lights to turn on or pressing a button to make a character in a game move.
Today, students will work in Sprite Lab, but the events they will be working on will be more like the video games they are used to playing. Events will take the form of actions, such as clicking the screen or two characters running into each other.
Main Activity (30 minutes)
Alien Dance Party with Sprite Lab
Goal: Today, students will be creating their own alien dance party! They’ll begin by reviewing how to put sprites on the screen, then they will assign them behaviors and learn to change those behaviors when an event is initiated.
Encourage students with questions/challenges to start by asking their partner. Unanswered questions can be escalated to a nearby group, who might already know the solution. Have students describe the problem that they’re seeing:
- What is it supposed to do?
- What does it do?
- What does that tell you?
Transition: Move students to their machines. Encourage students to follow the instructions for each puzzle. Help them realize that this is a creative activity, intended to help them learn Sprite Lab. It is not an assessment activity of any sort.
Wrap Up (10 minutes)
Reflection
Prompts:
- What was today's lesson about?
- How do you feel about today's lesson?
- How did it feel to have control over what your characters were able to do?
- Did you change the program in any way to make it feel more like your own?
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.