Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 909 Bytes

File metadata and controls

29 lines (25 loc) · 909 Bytes

Week 15 – Catch the Stars (Collisions + Error Handling)

Objectives

  • Implement collision detection using distance formula
  • Display and update score
  • NEW: Introduce try/except error handling
  • Use lists for object positions

New Concept: Error Handling

try:
    # Code that might cause errors
    result = risky_operation()
except Exception as e:
    # What to do if error occurs
    print(f"Error: {e}")

Why? Games should keep running even if something unexpected happens!

Lesson flow (60 min)

  1. Warm-up (10 min): Review distance formula from math
  2. Teach (15 min): Collision detection, try/except basics
  3. Build (20 min): Implement collection game with scoring
  4. Challenge (15 min): Multiple stars, different point values

Success Criteria

  • Working collision detection
  • Score updates when collecting stars
  • Understanding of try/except purpose