Level 5

Which Way Do I Face?

Level 5 · Chapter 2

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Algorithms & Programming · Grades 6–8

Combine loops and conditions, even nested ones.

Code 2-AP-12Read the official text

Common Core State Standards for Mathematics

The Number System · Grade 6

Use negative numbers on the number line.

Code 6.NS.C.6Read the official text

The short lines are our own words. We matched this lesson to these standards ourselves; the standards' owners have not reviewed or endorsed this course.

Common Core State Standards © 2010 National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Today you will control how a sprite rotates using set rotation style.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-AP-12 · ISTE 1.5.c · Standards
🎯 I cancontrol how a sprite rotates using set rotation style
🧩 New blocks1 block
📝 New words7 words
⏱ Lesson time~40 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students often confuse direction (the internal angle value) with rotation style (the visual rendering rule). Changing rotation style does not change direction — it only controls how the costume is drawn.
  • Students may think left-right means the sprite can only move left or right. Clarify: it can move anywhere, but the costume only flips, it never tilts.

🎯 Differentiation

🐢 Struggling: Start with concrete comparison — show a platformer game vs. a space shooter. Ask: which character would look wrong upside-down? Platformer. That character needs left-right style.

🚀 Advanced: Challenge students to build a top-down car game using don't rotate style where the car body always points up but velocity direction changes using direction math.

💡 During the lesson

  • Warm-UpAsk: "What would a platformer character look like with all-around rotation?" (It would go upside down when it faces left, direction = -90.) This motivates why the three styles exist as distinct choices.
  • Try ItRun the platformer script and press left/right. Then change the rotation style to "all around" and run again — pressing left makes Pico spin upside-down. This live comparison is the fastest way to build intuition.
    The second experiment is an important edge case — direction 135 means "down-right," but left-right style only maps left vs. right. The sprite appears as it does facing right (direction ≥ 0). Some students expect it to tilt diagonally — it does not.
  • PlanEmphasize that set rotation style is set ONCE at the start of the script — not inside the forever loop. Setting it every frame wastes resources without benefit.
  • BuildStep 6 shows the motivation by contrast — students see the problem before knowing the full solution. Steps 10-11 complete the three-way comparison: the badge proves "don't rotate" keeps a costume upright even when direction is set.