🗒 Cheat Sheet← Lesson
BitWithBite
Pygame Mastery Worksheet

🏗️ Game Architecture

Module 18 of 20 · Level ★★★ · Time: 40 min
SCORE___ / 20
NameClassDate
After this worksheet you can
Design a Scene base classSwitch scenes with a SceneManagerCentralize asset loadingUse a config module for constants
📚 Quick Recap

A Scene base class (handle_events/update/draw) lets every screen — menu, gameplay, game over — follow the same shape, while a SceneManager holds the current scene and swaps it on request. Centralized asset loading and a config.py constants module keep the codebase organized as it grows.

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

1What three methods does a typical Scene base class define?
2What does a SceneManager hold?
3Why centralize asset loading in one helper function?
4What typically lives in a config.py module?

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

5A Scene subclass overrides handle_events, update and .
6Switching scenes is usually done by calling manager.(new_scene).
7Write the SceneManager.switch_to() method that replaces the current scene.
8Why is scattering magic numbers (e.g. 800, 600, 60) across many files a maintenance problem?
9What's the benefit of the game loop only ever calling current_scene.update()/draw() instead of a giant if/elif chain checking game state everywhere?

🚀 Section C · Challenge ● CHALLENGE 5

10Design the scene flow for a simple game: MenuScene → PlayScene → GameOverScene → back to MenuScene. Describe what triggers each transition.
💭 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 draw   6 switch_to   7 = def switch_to(self, new_scene): self.scene = new_scene   8 = if the screen size ever changes, every file with a hardcoded 800/600 must be found and updated individually, which is error-prone and easy to miss a spot   9 = the game loop code stays simple and identical regardless of how many scenes exist — it just calls whatever the current scene's own update/draw are, instead of growing a huge if/elif chain that must be edited every time a new state is added  |  10 = MenuScene switches to PlayScene when the player clicks "Play"; PlayScene switches to GameOverScene when the player's health reaches 0 (or they complete the level); GameOverScene switches back to MenuScene when the player clicks "Return to Menu" (or presses a key)

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