Lesson 9: Sprite Movement
Game Lab
Overview
By combining the Draw Loop and the Counter Pattern, students write programs that move sprites across the screen, as well as animate other sprite properties.
Purpose
This lesson combines the Draw Loop that students first saw in Lesson 7 and the Counter Pattern that they learned in Lesson 8 to create programs with purposeful motion. By either incrementing or decrementing sprite properties, such as sprite.x
, you can write programs that move sprites in expected patterns, instead of the randomization that we used in the past. The animations that students learn to create in this lesson lay the foundation for all of the animations and games that they will make throughout the rest of the unit.
Objectives
Students will be able to:
- Use the counter pattern to increment or decrement sprite properties
- Identify which sprite properties need to be changed, and in what way, to achieve a specific movement
Warm Up (5 minutes)
The purpose of this discussion is to start students thinking about how they might use the various sprite properties they’ve seen so far to make animations with purposeful motion. If students struggle to come up with ideas, you can narrow down the question to specific properties. For example:
Reviewing Sprite Properties
Prompt: On a piece of scratch paper, list out all of the sprite properties you can think of and what aspect of a sprite they affect.
Discuss: What kinds of animations could you make by combining sprite properties with the counter pattern? Consider both adding and subtracting from properties, or even updating multiple properties at the same time. Record ideas as students share them on the board.
Activity (40 minutes)
Levels: Sprites and Images
Transition: Send students to Code Studio.
Support: Students should be progressing through the levels without stopping in this class. When they have finished the skill building levels they are given the option of which project they wish to extend.
Code Studio levels
Wrap Up (5 minutes)
Journal
Prompt: Have students reflect on their development of the five practices of CS Discoveries (Problem Solving, Persistence, Creativity, Collaboration, Communication). Choose one of the following prompts as you deem appropriate.
- Choose one of the five practices in which you believe you demonstrated growth in this lesson. Write something you did that exemplified this practice.
- Choose one practice you think you can continue to grow in. What’s one thing you’d like to do better?
- Choose one practice you thought was especially important for the activity we completed today. What made it so important?
TRY THE LESSON 9 CHALLENGES