Lesson 7: Alien Dance Party with Sprite Lab

Overview

This lesson features Sprite Lab, a platform where students can create their own interactive animations and games. In addition to behaviors, today students will incorporate user input as events to create an "alien dance party".

Purpose

Students will use events to make characters move around the screen, make noises, and change backgrounds based on user input. This lesson offers a great introduction to events in programming and even gives students a chance to show creativity! At the end of the puzzle sequence, students will be presented with the opportunity to share their projects.

Agenda

Warm Up (5 min)

Main Activity (30 min)

Wrap Up (10 min)

View on Code Studio

Objectives

Students will be able to:

  • Identify actions that correlate to input events.
  • Create an interactive animation using sprites, behaviors, and events.

Preparation

  • Play through the puzzles to find any potential problem areas for your class.
  • Make sure every student has a journal.

Vocabulary

  • Event - An action that causes something to happen.

Introduced Code

Support

Report a Bug

Teaching Guide

Warm Up (5 min)

Introduction

Today students will visit events in programming.

Demo: Ask the students to raise their hands in the air.

What you did was declare an event. When you say "raise your hands in the air" the students responded by raising their hands. In coding, you would declare this by saying something like "when I say 'raise your hands,' you raise your hands".

You can also think of cities as declaring events. There are laws that say "when there is a green light, cars move through the intersection".

Discuss: Ask the students why they think this is an event.

Today, students will play 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.

Display: Begin by showing Puzzle 1 to your students.

Think/Pair: Ask them to predict what will happen when the code is run, and to discuss with their neighbors. Run the code, and discuss the outcome.

Main Activity (30 min)

Online Puzzles

Teaching Tip

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?

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.

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 min)

Journaling

Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.

Journal 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?
  • Prediction
  • 1
  • (click tabs to see student view)
View on Code Studio

Student Instructions

Make a prediction: Here’s a sprite that looks like a blue alien!

What do you think will happen when you click on it?

  • Video
  • 2
  • (click tabs to see student view)
  • Mini-Project: Alien Dance Moves
  • 3
  • 4
  • 5
  • 6
  • (click tabs to see student view)
View on Code Studio

Teaching Tip

This lesson contains a mini-project called Alien Dance Moves. This progression may feel very different from what has come earlier in the course for you as well as your students. These levels have some new characteristics you may want to explore before starting.

  • The code your students write in one level will automatically transfer over to the other levels. This allows them to build gradually and iterate on their ideas as they learn.
  • These levels allow for more open-ended creativity. Empower your students to determine for themselves when they have completed each task. There is no one right answer!
  • Example solutions are available for this step of the progression which can be viewed by opening the teacher panel to the right.

This level will validate a student’s code by checking that the following conditions have been met: Student must click the sprite after pressing Run. The sprite needs to spin.

Student Instructions

The alien was proud of its dancing skills on Mars, but now it can only move side-to-side.

Replace the behavior block in the sprite begins block to a different one that will make the alien start spinning!

View on Code Studio

Teaching Tip

This lesson contains a mini-project called Alien Dance Moves. This progression may feel very different from what has come earlier in the course for you as well as your students. These levels have some new characteristics you may want to explore before starting.

  • The code your students write in one level will automatically transfer over to the other levels. This allows them to build gradually and iterate on their ideas as they learn.
  • These levels allow for more open-ended creativity. Empower your students to determine for themselves when they have completed each task. There is no one right answer!
  • Example solutions are available for this step of the progression which can be viewed by opening the teacher panel to the right.

This level will validate a student’s code by checking that the following conditions have been met: Student must create a pink alien sprite. The pink alien sprite must start a behavior when clicked.

Student Instructions

Create a new sprite that looks like a pink alien.

Make it do any move you want when it's clicked. Try using a new move this time!

View on Code Studio

Teaching Tip

This lesson contains a mini-project called Alien Dance Moves. This progression may feel very different from what has come earlier in the course for you as well as your students. These levels have some new characteristics you may want to explore before starting.

  • The code your students write in one level will automatically transfer over to the other levels. This allows them to build gradually and iterate on their ideas as they learn.
  • These levels allow for more open-ended creativity. Empower your students to determine for themselves when they have completed each task. There is no one right answer!
  • Example solutions are available for this step of the progression which can be viewed by opening the teacher panel to the right.

This level will validate a student’s code by checking that the following conditions have been met: Students must create three sprites using the blue alien, pink alien, and yellow alien costumes. Students must arrange the alien sprites in a horizontal line (within 50 pixels). * The yellow alien sprite needs to start a behavior when clicked.

Student Instructions

Form an alien dance crew!

  • Create a third sprite that looks like a yellow alien, and make it begin a dance move when clicked.
  • Set all of your aliens to stand in a horizontal line, like this:

View on Code Studio

Teaching Tip

This lesson contains a mini-project called Alien Dance Moves. This progression may feel very different from what has come earlier in the course for you as well as your students. These levels have some new characteristics you may want to explore before starting.

  • The code your students write in one level will automatically transfer over to the other levels. This allows them to build gradually and iterate on their ideas as they learn.
  • These levels allow for more open-ended creativity. Empower your students to determine for themselves when they have completed each task. There is no one right answer!
  • Example solutions are available for this step of the progression which can be viewed by opening the teacher panel to the right.

This level will validate a student’s code by checking that the following conditions have been met: * Student must change the color of each of the three alien sprites.

Student Instructions

Let's try using a different kind of event.

Create a single keypress event using the keypress event block.

For this event, make it so that when a key is pressed, each of your aliens changes color! Choose any key you like, but if you are using a touch screen we recommend up, down, left, or right.

  • Mini-Project: Alien Dance Party
  • 7
  • 8
  • 9
  • (click tabs to see student view)
View on Code Studio

Teaching Tip

This lesson contains a mini-project called Alien Dance Party. This progression may feel very different from what has come earlier in the course for you as well as your students. These levels have some new characteristics you may want to explore before starting.

  • The code your students write in one level will automatically transfer over to the other levels. This allows them to build gradually and iterate on their ideas as they learn.
  • These levels allow for more open-ended creativity. Empower your students to determine for themselves when they have completed each task. There is no one right answer!
  • Example solutions are available for this step of the progression which can be viewed by opening the teacher panel to the right.

This level will validate a student’s code by checking that the following conditions have been met: * All alien sprites must stop their behaviors.

Student Instructions

These aliens are running wild! Let's calm them down by ringing a bell.

First add a new sprite that looks like a bell.

Then add an event that makes each alien stop dancing when the bell is clicked, using the stops everything block!

View on Code Studio

Teaching Tip

This lesson contains a mini-project called Alien Dance Party. This progression may feel very different from what has come earlier in the course for you as well as your students. These levels have some new characteristics you may want to explore before starting.

  • The code your students write in one level will automatically transfer over to the other levels. This allows them to build gradually and iterate on their ideas as they learn.
  • These levels allow for more open-ended creativity. Empower your students to determine for themselves when they have completed each task. There is no one right answer!
  • Example solutions are available for this step of the progression which can be viewed by opening the teacher panel to the right.

This level will validate a student’s code by checking that the following conditions have been met: * The blue alien sprite needs to start a new behavior.

Student Instructions

For the pink alien, fun is contagious! Touching it makes anyone want to dance!

Use the when touching event block to make the blue alien begin a new dance move when the pink alien touches it.

View on Code Studio

Teaching Tip

This lesson contains a mini-project called Alien Dance Party. This progression may feel very different from what has come earlier in the course for you as well as your students. These levels have some new characteristics you may want to explore before starting.

  • The code your students write in one level will automatically transfer over to the other levels. This allows them to build gradually and iterate on their ideas as they learn.
  • These levels allow for more open-ended creativity. Empower your students to determine for themselves when they have completed each task. There is no one right answer!
  • Example solutions are available for this step of the progression which can be viewed by opening the teacher panel to the right.

This level will validate a student’s code by checking that the following conditions have been met: Students must have at least one costume in their project. Students must create three sprites with unique costumes.

Student Instructions

Now create your own alien disco! Looking for inspiration? Try these ideas: Create another alien that does another move when clicked. Make aliens do more dance moves when they touch each other.

Standards Alignment

View full course alignment

CSTA K-12 Computer Science Standards (2017)

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.