🗒 Cheat Sheet← Lesson
BitWithBite
Pygame Mastery Worksheet

💥 Collision Detection

Module 9 of 20 · Level ★★☆ · Time: 35 min
SCORE___ / 20
NameClassDate
After this worksheet you can
Detect Rect and circle collisionsExplain hitboxes vs hurtboxesUse trigger zones for eventsExplain collision optimization basics
📚 Quick Recap

Rect collision (colliderect) is the fast default; circle collision compares center distance to summed radii; mask collision is pixel-perfect but slow. Hitboxes deal damage, hurtboxes receive it, and trigger zones detect overlap without physical response.

🧠 Section A · Concept Check ● INTERMEDIATE 4 × 1 = 4

1Which is the fastest, most common collision check?
2How is circle collision detected?
3What does a hurtbox represent?
4What is a trigger zone?

🧮 Section B · Problem Solving ● INTERMEDIATE 2 + 3×3 = 11

5pygame.sprite.collide_mask checks collision at the level.
6A hitbox damage; a hurtbox receives it.
7Write the if-condition to check if player.rect overlaps enemy.rect.
8Why is mask collision slower than rect collision?
9Describe one way to optimize collision checks when there are hundreds of objects.

🚀 Section C · Challenge ● CHALLENGE 5

10A circular coin sprite uses rect collision and feels "wrong" — the player can collect it while visibly not touching it. Explain why this happens and how switching to circle collision fixes it.
💭 Reflection — the most useful thing I learned:
A ___/4   B ___/11   C ___/5   Total ___/20 Teacher's Signature Parent's Signature
✂ answer key — fold or cut before handing out

1-B   2-B   3-B   4-A  |  5 pixel   6 deals   7 = if player.rect.colliderect(enemy.rect):   8 = it compares actual non-transparent pixels between two images every check, far more computation than comparing four rectangle edge values   9 = only check objects that are near each other (e.g. grid/spatial partitioning or a broad distance check) instead of comparing every object against every other object each frame  |  10 = a rectangular bounding box includes the empty corner space around a round sprite, so the player can trigger a "collision" while only touching that empty corner area; circle collision compares actual center-to-center distance against the combined radii, matching the coin's real round shape

📄 Need offline practice?Download the print-ready PDF or open the one-page cheat sheet.
⬇ Worksheet PDF 🗒 Cheat Sheet