Lesson 4: Mini-Project: Virtual Pet
60 minutes
Overview
Students will create an interactive Virtual Pet that looks and behaves how they wish in this mini-project lesson. Students will use Sprite Lab's "Costumes" tool to customize their pet's appearance. They will then use events, behaviors, and other concepts they have learned to bring their project to life.
Purpose
This lesson allows students to apply programming concepts from prior lessons in another creative context.
Standards
AP - Algorithms & Programming
- 1B-AP-10 - Create programs that include sequences, events, loops, and conditionals.
- 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
- 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-13 - Use an iterative process to plan the development of a program by including others' perspectives and considering user preferences.
Agenda
Objectives
Students will be able to:
- Create an interactive virtual pet using events, behaviors, and custom art.
- Program solutions to problems that arise when designing a virtual pet, like feeding it.
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 teachers
- Sprite Lab Documentation - Resource
Vocabulary
- Behavior - An action that a sprite performs continuously until it’s told to stop.
- Event - An action that causes something to happen.
Teaching Guide
Warm Up (15 minutes)
Introduction
Revisit events and behaviors in programming. Additionally, introduce the Sprite Lab "Costumes" tool that allows students to draw their own costumes.
Review: Ask students questions about events and behaviors.
-
Do you remember what an event is?
-
Do you remember what a behavior is?
-
Can you remember some of the behaviors you have used ? What do they do?
- "patrolling"
- "jittering"
- "spinning right/left"
Display: Begin by showing Level 1 of today's lesson to your students.
Think/Pair: Ask students to predict what will happen when the code is run, and to discuss with their neighbors. Run the code, and discuss the outcome.
Display: Show Level 2. Briefly demonstrate how to do the following:
- Navigate between the Code and Costumes tabs.
- Draw a costume.
- Choose a costume from the costume library.
- Change the virtual pet's sprite's costume to a custom one.
Main Activity (30 minutes)
Virtual Pet with Sprite Lab
Goal: Today, students will be creating their own virtual pet! They will begin by drawing or selecting a new costume for a sprite. Then they will create events that cause actions and behaviors upon interaction.
Online Puzzles
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.
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?
Reminder: If puzzles are sharable, remind the students to only share their work with their close friends or family.
Wrap Up (15 minutes)
Reflection
Prompts:
- What was today's lesson about?
- How do you feel about today's lesson?
- What other options would you like to be able to have your pet do?
Cross-Curricular Opportunity
Providing Energy for your Virtual Pet (60-90 minutes)
Computer Science + English Language Arts + Science
Providing Energy for your Virtual Pet is an optional activity aligned to Common Core ELA and Next Generation Science Standards, written by our teacher community. Students will create a scientific model that shows how their virtual pet will receive the energy it needs to survive.
Standards Addressed:
-
CCSS.ELA.RI.5.7: Draw on information from multiple print or digital sources, demonstrating the ability to locate an answer to a question quickly or to solve a problem efficiently.
-
CCSS.ELA.RI.5.9: Integrate information from several texts on the same topic in order to write or speak about the subject knowledgeably.
-
5- PS3-1: Use models to describe that energy in animals’ food (used for body repair, growth, motion, and to maintain body warmth) was once energy from the sun.
-
5-LS2-1: Develop a model to describe the movement of matter among plants, animals, decomposers, and the environment
-
SL.5.5: Include multimedia components (e.g., graphics, sound) and visual displays in presentations when appropriate to enhance the development of main ideas or themes.
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.