Lesson 24: Swimming Fish in Sprite Lab

Overview

In this lesson, students will learn about the two concepts at the heart of Sprite Lab: sprites and behaviors. Sprites are characters or objects on the screen that students can move, change, and manipulate. Behaviors are actions that sprites will take continuously until they are stopped.

Purpose

This lesson is designed to introduce students to the core vocabulary of Sprite Lab, and allow them to apply concepts they learned in other environments to this tool. By creating a fish tank, students will begin to form an understanding of the programming model of this tool, and explore ways they can use it to express themselves.

Agenda

Warm Up (10 min)

Main Activity (20 min)

Wrap Up (15 min)

View on Code Studio

Objectives

Students will be able to:

  • Define “sprite” as a character or object on the screen that can be moved and changed.
  • Create a new sprite and choose its appearance.

Preparation

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

Links

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

For the Students

Vocabulary

  • Behavior - An action that a sprite performs continuously until it’s told to stop.
  • Sprite - A graphic on the screen with a location, size, and appearance.

Support

Report a Bug

Teaching Guide

Warm Up (10 min)

Introduction

Content Corner

Teaching this course as a class?

Our grade-aligned CS Fundamentals courses use unplugged lessons to build community and introduce tricky computer science concepts, including sprite behaviors. Check out the lesson Simon Says from Course E!

Today students will learn how to work with sprites in Sprite Lab.

Display: Pull up a previous puzzle from Code.org, ideally one containing a "main character" like Scrat from Ice Age or one of the Angry Birds.

Discuss: Let the students know that this character on the screen is a "sprite." It is a graphic that is controlled by a program. In this lesson, students will have the opportunity to choose their own sprites to control.

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.

Now is a great time to introduce the lesson vocabulary.

Main Activity (20 min)

Goal: Today, students will be creating their own Fish Tank. They’ll begin by learning how to put some sprites on the screen, then they will make them move. Finally, they’ll customize their fish tank to add whatever creatures and objects they want.

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?

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. It is not an assessment activity of any sort.

Reminder: If puzzles are sharable, 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 (15 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 make a scene that was more creative?
  • Was it difficult to finish a lesson where there was no clear "right" and "wrong"?
View on Code Studio

Student Instructions

Attach the flap a normal amount block to the when click event, then press "Run".


Click or tap on the play space to move Flappy to the target.

View on Code Studio

Student Instructions

The when run event allows you to run code as soon as your game starts.

Try adding a block that sets the level speed when the "Run" button is pressed.


Play the game and flap to the target to continue.

View on Code Studio

Student Instructions

Now we've added the ground.

Attach the end game block to the when hit the ground event.


Play the game and crash the bird into the ground to continue.

View on Code Studio

Student Instructions

Flappy will fly right through obstacles unless you write code to make him crash.

Attach a block to the when hit an obstacle event so that the game ends when Flappy crashes into the first set of pipes.

View on Code Studio

Student Instructions

We've added a scoreboard to count points when Flappy passes obstacles.

Add a block to the when pass an obstacle event that scores a point, then press "Run" to fly Flappy through the first set of pipes.

View on Code Studio

Student Instructions

Click the down arrow inside of the flap a normal amount block to pick a different flapping power.

See if you can still score a point after making Flappy flap either a smaller or larger amount each time you click.

View on Code Studio

Student Instructions

Next, try changing the scene by attaching a block to the when run event.

View on Code Studio

Student Instructions

You can set the background under any event, not just when the game starts.

Try setting a random scene when other events happen...for example, when passing an obstacle.

View on Code Studio

Student Instructions

To mix things up, instead of ending the game when Flappy hits an obstacle, try setting the score back to 0.

View on Code Studio

Student Instructions

Create your own Flappy game!

You can change the visuals and the rules...even the gravity! When you're done, click "Finish" to share with friends on their phones.

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.

Cross-curricular Opportunities

This list represents opportunities in this lesson to support standards in other content areas.

Common Core English Language Arts Standards

L - Language
  • 4.L.6 - Acquire and use accurately grade-appropriate general academic and domain-specific words and phrases, including those that signal precise actions, emotions, or states of being (e.g., quizzed, whined, stammered) and that are basic to a particular topic (e.g
SL - Speaking & Listening
  • 4.SL.1 - Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 4 topics and texts, building on others’ ideas and expressing their own clearly.
  • 4.SL.1.a - Come to discussions prepared, having read or studied required material; explicitly draw on that preparation and other information known about the topic to explore ideas under discussion.
  • 4.SL.4 - Report on a topic or text, tell a story, or recount an experience in an organized manner, using appropriate facts and relevant, descriptive details to support main ideas or themes; speak clearly at an understandable pace.
  • 4.SL.6 - Differentiate between contexts that call for formal English (e.g., presenting ideas) and situations where informal discourse is appropriate (e.g., small-group discussion); use formal English when appropriate to task and situation.
W - Writing
  • 4.W.6 - With some guidance and support from adults, use technology, including the Internet, to produce and publish writing as well as to interact and collaborate with others; demonstrate sufficient command of keyboarding skills to type a minimum of one page in a

Common Core Math Standards

MP - Math Practices
  • MP.1 - Make sense of problems and persevere in solving them
  • MP.2 - Reason abstractly and quantitatively
  • MP.5 - Use appropriate tools strategically
  • MP.6 - Attend to precision
  • MP.7 - Look for and make use of structure
  • MP.8 - Look for and express regularity in repeated reasoning

Next Generation Science Standards

ETS - Engineering in the Sciences
ETS1 - Engineering Design
  • 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.
  • 3-5-ETS1-2 - Generate and compare multiple possible solutions to a problem based on how well each is likely to meet the criteria and constraints of the problem.