< Course E (2022)

Lesson 4: Hello World

45 minutes

Overview

In this skill-building lesson, students will learn to create and animate sprites and make them interactive using events.

Purpose

This lesson is intended to prepare students to create simple programming projects in Sprite Lab. Students will learn how to make sprites say things, which is a skill they will use in the following About Me lesson.

CSTA K-12 Computer Science Standards (2017)
    • 1A-AP-11 - Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions.
    • 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.
    • 1A-IC-17 - Work respectfully and responsibly with others online.

Agenda

Objectives

Students will be able to:
  • Create an interactive animation using sprites and events.
  • Create new sprites and assign them costumes and locations.

Preparation

  • Play through the puzzles to find any potential problem areas for your class.
  • [Optional] Use the resources at CS Connections to make a plan for more computer science learning after the initial tutorial.

Links

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

For the teachers

Teaching Guide

Warm Up (10 minutes)

Setting the Stage

Welcome students to class and very briefly introduce the day’s activity.

Display: Show “Reflect” slide

Reflect: How do we use sprites in our programs?

A Series of Events

Display: Show “A Series of Events” slide

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

Vocabulary

Display: Show “Vocabulary” slide

In Computer Science, events cause other actions to happen.

  • Event - An action that causes something to happen

Remarks

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.

Remarks

In this activity, you’re going to have fun making an interactive world with fun characters called sprites. You’ll be able to make the sprites say things with speech bubbles as you’d see in a comic or graphic novel, and you’ll learn to make them respond automatically when you or someone else clicks on them.

Today you’ll be writing "code", which just means a set of instructions that a computer can understand. When you write a story, you need to think carefully about the words you use. When you write code, you’ll need to think carefully about the instructions you are giving to your computer.

Main Activity (25 minutes)

General Support

Here are a few tips that should help students regardless of the level they're working on

  • Collaborate with Neighbors: Encourage students to check in with a neighbor when they're getting stuck. Depending on the age and ability of your students, you might consider formally breaking your class into pairs to complete the tutorial using pair programming.

  • Read the Instructions: The instructions usually provide helpful tips on how to complete the level. Before giving students the answer, ensure they've carefully looked at the instructions, hints, videos, and any starter code carefully.

  • Stuck? Look for hints: Each level includes a hint with advice for how to pass a level, including which blocks of code to try out.

  • Take your time and experiment. The instructions tell students generally what to do, but they should also feel free to try out their own ideas.

Hello World

Display: Show “Welcome to Sprite Lab” video

Display: Show “Programming with Events” video

Display: Show “Do What You Want” video

Display: Show “Level 14 - Free Play” slide

If a group or individual finishes early, encourage them to continue building a project in the last level. If students aren’t sure what else to do, you can prompt them with questions:

  • What other sprites could you add to your project?
  • Have you looked through the costume library or tried drawing your own sprite costume?
  • What else could you have your sprites say?
  • What should your sprites do when they are clicked?
  • Invite students to share ideas and to learn from each other. They can also attempt another tutorial by visiting code.org/learn.

Wrap Up (10 minutes)

Reflection

Display: Show “Reflect” slide

Reflect:

  • What did you learn today about sprites?
  • How do events work in your code?

Extended Learning

With skills learned in this Hello World lesson, students are able to create projects on any topic, such as another school topic or something personally relevant to them. Visit CS Connections for ideas about how to integrate computer science into other subjects.

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.