🗒 Cheat Sheet← Lesson
BitWithBite
Pygame Mastery Worksheet

🧩 Sprites

Chapter: Pygame Mastery · Level ★★★ · Time: 25 min
SCORE___ / 20
NameClassDate
After this worksheet you can
Build a Sprite subclass with image and rectUpdate and draw hundreds of objects with a GroupControl draw order with LayeredUpdatesSlice sprite sheets and drive animation states
📚 Quick Recap

Pygame's Sprite class and Group system give every game object a standard shape — an image, a rect, and update/draw logic — so hundreds of enemies, bullets, or coins can be managed with just a few lines of code. LayeredUpdates adds explicit draw ordering, and sprite sheets let one image supply every animation frame a character needs.

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

1Every pygame.sprite.Sprite subclass must define:
2Calling group.draw(screen) does:
3Which class controls draw order using explicit layers?
4The main benefit of slicing a sprite sheet once at load time is:

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

5Calling group.update() calls the method on every sprite inside it.
6To remove a sprite from every group it belongs to in one line, call sprite.().
7Name the two attributes every Sprite subclass must define, and what each one is for.
8Why should you always call super().__init__() first inside a Sprite subclass's __init__?
9Explain why slicing a sprite sheet once at load time (rather than every frame) matters for performance.

🚀 Section C · Challenge ● CHALLENGE 5

10You have a background sprite, a player sprite, and a HUD sprite that must always draw in that exact order no matter when they were added to the group. Which sprite container would you use, and how would you set it up?
💭 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-B  |  5 update   6 kill   7 = self.image (the Surface drawn) and self.rect (position used for drawing/collisions)   8 = it wires the object into Pygame's internal sprite bookkeeping so it can be added to Groups correctly   9 = slicing costs time; doing it once avoids repeating that cost 60 times a second, keeping frame rate high  |  10 = pygame.sprite.LayeredUpdates, adding each sprite with an explicit layer (background=0, player=1, HUD=2) — draw() then respects layer order regardless of add() order

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