🗒 Cheat Sheet← Lesson
BitWithBite
Pygame Mastery Worksheet

🖼️ Working with Images

Module 4 of 20 · Level ★☆☆ · Time: 30 min
SCORE___ / 20
NameClassDate
After this worksheet you can
Load and convert images correctlyScale, rotate and flip spritesManage transparency and alphaOrganize an assets folder efficiently
📚 Quick Recap

Images are loaded once into Surfaces with pygame.image.load(), converted for fast blitting, then transformed (scale/rotate/flip) via pygame.transform — which always returns a new Surface rather than modifying the original.

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

1Why call .convert() or .convert_alpha() after loading?
2Which format supports real per-pixel transparency?
3What does pygame.transform.rotate() return?
4What does img.set_alpha(128) do?

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

5pygame.transform.(img, True, False) mirrors an image horizontally.
6Loading images inside the game loop is bad because it's a slow operation.
7What's the difference between .convert() and .convert_alpha()?
8Why should rotated animation frames be pre-generated instead of rotated live every frame?
9Describe a good pattern for loading and storing all of a game's images at startup.

🚀 Section C · Challenge ● CHALLENGE 5

10You need a player sprite to face left and right. Explain two different ways to get a mirrored version, and which is more efficient at runtime.
💭 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 flip   6 disk-read   7 = .convert() is for opaque images; .convert_alpha() preserves per-pixel transparency for images with alpha channels   8 = rotating every frame is CPU-expensive; pre-generating a list of rotated frames once trades a bit of memory for much better runtime speed   9 = load every image once at startup into a dictionary keyed by name, then reference that dictionary everywhere instead of reloading from disk  |  10 = (a) load a separate pre-drawn left-facing image, or (b) use pygame.transform.flip(img, True, False) on the right-facing image once and cache the result — option (b) is more efficient since it avoids managing double the art assets and only flips once, not every frame

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