Lesson 9: Sprite Properties
45 minutes
Overview
In the last lesson, when students were introduced to sprites, they focused mainly on creating a sprite and assigning it an animation. This lesson starts to dig into what makes sprites such a powerful programming construct - that they have properties that can be modified as a program is running. This lays the foundation for much of what students will be doing in the rest of the unit in terms of accessing and manipulating sprite properties to create interesting behaviors in their programs. The lesson starts with a review of what a sprite is, then students move on to Game Lab to practice more with sprites, using their properties to change their appearance. They then reflect on the connections between properties and variables.
Question of the Day: How can we use sprite properties to change their appearance on the screen?
Standards
AP - Algorithms & Programming
- 2-AP-11 - Create clearly named variables that represent different data types and perform operations on their values.
- 2-AP-13 - Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
- 2-AP-17 - Systematically test and refine programs using a range of test cases.
- 2-AP-19 - Document programs in order to make them easier to follow, test, and debug.
Agenda
Objectives
Students will be able to:
- Use dot notation to update a sprite's properties
Preparation
- Check the "Teacher's Lounge" forum for verified teachers to find additional strategies or resources shared by fellow teachers
- If you are teaching virtually, consider checking our Virtual Lesson Modifications
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the teachers
- Sprite Properties - Resource
- Sprite Properties - Slides
For the students
- Sprite Properties - Video (Download)
Vocabulary
- Dot notation - the way that sprites' properties are used in Game Lab, by connecting the sprite and property with a dot.
- Property - A label for a characteristic of a sprite, such as its location and appearance
Introduced Code
Teaching Guide
Warm Up (5 minutes)
Prompt: What is your definition of a sprite? What sprite properties do you know how to use? What other sprite properties might be useful?
Allow students time to reflect on their own and then with a partner before sharing out to the entire group. It's okay if students do not have a canonical definition of a sprite, but they should recognize that a sprite is a part of the program that has several different properties that control its location and appearance.
Remarks
So far, we've only been able to control our sprite's location and animation, but today, we're going to learn how to update other sprite properties so we can make even better programs.
Question of the Day: How can we use sprite properties to change their appearance on the screen?
Activity (35 minutes)
Transition: Send students to Code Studio.
Guide to Programming Levels: Additional guidance for programming levels is provided in the CSD Guide to Programming Levels. This document includes strategies and best-practices for facilitating programming levels with students.
Video: Show students the Sprite Properties video in the slides.
Key Vocabulary:
- Property: A label for a characteristic of a sprite, such as its location and appearance
- Dot notation: the way that sprites' properties are used in Game Lab, by connecting the sprite and property with a dot.
To encourage active engagement and reflection, use one or more of the strategies discussed in the Guide to Curriculum Videos.
Formative Assessment: This level can be used as a formative assessment. A rubric is provided in the level, and written feedback can be given to students. Click here to learn more about giving feedback to students.
Wrap Up (5 minutes)
Question of the Day: How can we use sprite properties to change their appearance on the screen?
Journal Prompt: What is one way sprite properties are the same as variables? What's one way that sprite properties are different from variables?
Discuss: Allow students to discuss in pairs or small groups before sharing out to the entire group.
Discussion Goal: Students may note that sprite properties and variables are similar in that they both store information. They are different in that variables can be anything, but sprites have particular properties that are used in certain ways on the screen.
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.