Visual Game Builder
The friendliest entry into graphical games — sprites, sound, simple physics. Forty-eight one-hour lessons threaded with a dozen mini-games (Pong Lite, Brick Breaker, Asteroids, Endless Runner) leading to a two-part arcade-game capstone. Prerequisite: Python Level 2 (collections + files).
What you should already know
- From Python L1: variables & types,
if/elif/else,while/forloops, lists (index, append, slice), functions with parameters andreturn, therandommodule. - From Python L2: dictionaries, tuples, nested data, string methods & f-strings,
import, file I/O withwith, basictry/except. - Placement assessment available — 10–15 questions, ~30 minutes, 70% pass mark.
- 01
What Is Pygame Zero? Install & First Window
Install
pgzero, run an empty window, save the file. - 02
The Game Loop:
draw()&update()How a game ticks — 60 times per second.
- 03
Coordinates: Screen Origin & y-Axis
x, y and why y goes downwards in graphics.
- 04
Drawing Shapes: Rect, Circle, Line
Filled and outlined primitives.
- 05
Colours & Backgrounds
RGB tuples, named colours, gradient hacks.
- 06
Mini-Game: Doodle Pad
Draw with the mouse, clear with space.
- 07
Actors: Your First Sprite
Load an image, place it on the canvas.
- 08
Moving Actors:
actor.x += 1The simplest way to push a sprite around.
- 09
Velocity & Time-Based Movement
Why frame-rate-independent movement matters.
- 10
Multiple Actors: Lists of Sprites
Spawn many; update them all in a loop.
- 11
Mini-Game: Cat Parade
Ten cats walking in a line, each at its own speed.
- 12
Challenge: 100 Sprites at 60 FPS
Spawn 100 actors and keep the frame rate locked.
- 13
Keyboard Input: Arrow Keys
The
keyboardobject — held vs pressed. - 14
Keyboard Input: Multiple Keys at Once
Diagonal movement, run + jump combos.
- 15
Mouse Input: Click & Drag
on_mouse_down,on_mouse_move,on_mouse_up. - 16
Mini-Game: Sky Painter
Paint trails on the screen with the arrow keys.
- 17
Mini-Game: Bug Squasher
Click moving bugs before they escape.
- 18
Mini-Game: Cat & Mouse Chase
WASD to dodge, score for survival time.
- 19
Collision Detection:
colliderectHave two rectangles overlapped this frame?
- 20
Collision:
collidepoint(Mouse on Actor)Did the user click on the right sprite?
- 21
Collision Reactions: Bounce, Destroy, Score
What to do when things touch.
- 22
Mini-Game: Pong Lite
Two paddles, one ball, infinite rally.
- 23
Mini-Game: Brick Breaker
Smash a wall of bricks with a bouncing ball.
- 24
Sprite Animation: Cycle Frames
Swap costumes every few frames — a walking animation.
- 25
Sprite Animation: Direction-Based Frames
Face left, face right, face up — without flipping by hand.
- 26
Sound Effects:
sounds.boom.play()One-shot sounds that fire on event.
- 27
Background Music with
music.playLoop a track; fade in / fade out.
- 28
Mini-Game: Falling Stars with Sound
Catch the stars; chime on hit, thud on miss.
- 29
Mini-Game: Drum Machine
Click pads, schedule beats, play a loop.
- 30
Score, Lives & Health Bars
The numbers every arcade game shows.
- 31
Game States: Start → Play → Game Over
A single state variable, branching draw and update.
- 32
Saving High Scores to a File
Top 5 scores survive between sessions.
- 33
Mini-Game: Asteroids Lite — Part 1 (Movement)
Rotate, thrust, wrap around the screen.
- 34
Mini-Game: Asteroids Lite — Part 2 (Game States)
Start screen, play, game-over — and a hi-score table.
- 35
Simple Physics: Gravity & Jump
Constant downward acceleration; an impulse up.
- 36
Bouncing & Friction
Energy loss on each bounce; sliding to a stop.
- 37
Mini-Game: Gravity Catcher
Catch falling objects in a basket.
- 38
Mini-Game: Endless Runner — Part 1 (Movement)
Player runs; world scrolls; jump on spacebar.
- 39
Mini-Game: Endless Runner — Part 2 (Obstacles)
Procedurally spawn rocks and pits; score for distance.
- 40
Tile-Based Backgrounds
Build a level out of 16×16 tiles.
- 41
Scrolling Backgrounds
Parallax layers — clouds, hills, foreground.
- 42
Multiple Levels & Difficulty Curves
Progressive challenge — speed and spawn rates.
- 43
Particles: Explosions & Trails
Small sprites with short lives — fireworks made of code.
- 44
Screen Shake & Hit Flashes
The two tricks that make every hit feel solid.
- 45
Title, Pause & Game Over Screens
Three more states; clean transitions; clear instructions.
- 46
Challenge: Make Your Game Feel "Juicy"
Take a working game; add shake, particles, sound polish.
- 47
Capstone Part 1: Plan & Build Your Arcade Game
Choose a genre, sketch the design, build the prototype.
- 48
Capstone Part 2: Polish & Share
Add sound, score, juicy polish, and show it to your class.
Game Engineering
The full power of Pygame — sprite classes, scenes, particle systems, tile maps, 2D physics, dirty-rect optimisation. Forty-eight one-hour lessons, building toward a polished side-scroller capstone with parallax, particles, music and save slots. Prerequisite: Python Level 3 (OOP). Module 1 recommended first.
What you should already know
- From Python L1–L2: everything required for Module 1 · Pygame Zero (above).
- From Python L3 — OOP: classes,
__init__, methods, inheritance,super(), encapsulation, polymorphism, dunder methods (__str__,__eq__,__add__). - From Python L3 — Functional: lambdas, comprehensions, generators (
yield), iterators,map/filter. - From Python L3 — Algorithms & DS: recursion, linear & binary search, basic sorting, big-O intuition, stacks & queues, linked-list mental model.
- Recommended: Module 1 · Pygame Zero — gives you the game-loop and sprite mental model before facing Pygame's boilerplate.
- Placement assessment available — 15–20 questions, ~45 minutes, 70% pass mark.
- 01
Pygame vs Pygame Zero
Why go deeper, and what Pygame Zero hid from you.
- 02
Setting Up:
pygame.init()& the Main LoopThe classic
while running:pattern. - 03
The Event System: Queue & Polling
Keyboard, mouse, quit — all through one queue.
- 04
Display Surface & Drawing Primitives
Surfaces, blits, and what actually gets drawn.
- 05
Coordinates & the
RectObjectThe Swiss-army knife of Pygame geometry.
- 06
Loading & Drawing Images
convert_alpha,blitand image performance. - 07
Sprites as Classes: Your First Player
OOP applied — every entity is a class.
- 08
Sprite Class: Image, Rect &
update()The three things every sprite must have.
- 09
Movement & Velocity Vectors
Smooth movement using x/y velocity components.
- 10
Diagonal Speed Normalisation
Why diagonal moves shouldn't feel faster.
- 11
Sprite Groups: Many Objects, One Update
Group.update()andGroup.draw(). - 12
Sprite Group Performance: Why Groups Matter
Spawn 1,000 sprites; keep 60 FPS.
- 13
Collision:
colliderectRectangle-vs-rectangle, the fast default.
- 14
Collision:
spritecollide&groupcollideOne sprite vs a group; group vs group.
- 15
Collision: Pixel-Perfect Masks
When rectangles aren't accurate enough.
- 16
Mini-Game: Top-Down Shooter — Part 1 (Player)
Player class, movement, shooting bullets.
- 17
Mini-Game: Top-Down Shooter — Part 2 (Enemies & Bullets)
Enemy spawner, sprite groups, collision resolution.
- 18
Mini-Game: Top-Down Shooter — Part 3 (Score & Game Over)
HUD, hi-score table, restart loop.
- 19
Sprite Sheets: Slicing Frames
One PNG, many frames — load once, blit cheap.
- 20
Animation: Frame Timing with Delta-Time
Animations that run at the same speed on every machine.
- 21
Animation: State Machine (Idle, Run, Attack)
Pick the right animation for the current action.
- 22
Mini-Game: Animated Boss Fight
Multi-phase boss with sprite-sheet animations.
- 23
Tile Maps: Loading Levels from CSV
A 2D grid of numbers → a 2D world of tiles.
- 24
Tile Maps: Loading from Tiled .tmx
Use the Tiled editor; load the file in Python.
- 25
Camera & Scrolling: Follow the Player
When the world is bigger than the window.
- 26
Camera: Smooth Lerp & Dead Zones
Cameras that don't snap or jitter.
- 27
Parallax Backgrounds
Layers that scroll at different speeds — instant depth.
- 28
Mini-Game: Side-Scroller — Part 1 (Movement & Camera)
Player + tile map + smooth-follow camera.
- 29
2D Physics: Gravity, Walking, Jumping
Velocity, gravity, ground detection.
- 30
2D Physics: Platform Collision Resolution
How to stop the player from falling through floors.
- 31
2D Physics: Wall Slides & Coyote Jump
Two tricks that make platformers feel right.
- 32
Mini-Game: Side-Scroller — Part 2 (Physics & Polish)
Add gravity, jumps, collectibles and a goal.
- 33
Particle Systems: Basic Particle Class
A short-lived sprite with velocity and a fade-out.
- 34
Particle Systems: Emitters & Object Pools
Spawn thousands without allocating thousands.
- 35
Mini-Game: Particle Showcase (Fireworks)
Click to launch; explode in colour.
- 36
Scene Management: Stack-Based State Machine
Push a pause scene; pop it back to the game.
- 37
HUD: Score, Health, Mini-Map
Drawing on top of the world.
- 38
UI: Buttons & Menus from Scratch
Click areas, hover states, keyboard navigation.
- 39
Title → Game → Pause → Game Over Flow
Four scenes, clean transitions, no leaks.
- 40
Settings Screen: Volume & Controls
Keybinds the player can change at runtime.
- 41
Sound Mixer: Music + SFX Channels
Background music, layered effects, master volume.
- 42
Sound Mixer: Channel Management
Reserve channels so important sounds aren't cut off.
- 43
Saving Progress: JSON + Pygame
High scores, settings, and a continue button.
- 44
Save Slots: Multiple Save Files
Three saves; load, overwrite, delete.
- 45
Performance: FPS Counter & Profiling
Measure before you optimise; show FPS in the HUD.
- 46
Performance: Dirty-Rect Drawing & Surface Re-Use
Two tricks that double the frame rate on slow machines.
- 47
Capstone Part 1: Design & Build
Choose a genre, plan the game, ship a playable prototype.
- 48
Capstone Part 2: Polish, Test & Ship
Particles, sound, save system, and a public release.
Build a Platformer, Step by Step
One game, eight lessons, and nothing written that you cannot immediately run. Each lesson is a short run of stages — a window, a fall, a landing, a jump, a skeleton pacing a ledge, a health bar draining — and every stage ends with something new on screen. Prerequisite: Module 1, or any Pygame Zero experience up to collisions.
What you should already know
- From Python: variables,
if/else,whileandforloops, lists, tuples, functions with parameters andreturn. - From Module 1 (or equivalent):
Actor,draw()andupdate(), reading the keyboard, and the idea that two rectangles can overlap. - Not needed: classes. The whole game is written with lists, functions and attributes hung on Actors.
- Starter kit: three images plus
pgzhelper.py, downloaded once in lesson 1.
- 01
Project Setup & the Player on Screen
The folder Pygame Zero insists on, a blue window, and
subrect— why the rectangle is not the drawing. - 02
Walk and Fall — Velocity & Gravity
Store movement in
vx, make gravity accelerate, and cap the fall so nothing tunnels. - 03
Build the Level and Land on It
A level as data, and the move-then-repair trick that turns falling into standing.
- 04
Jump, Walls and Facing
One shove upward, a second collision pass for walls, and a sprite that faces the way it walks.
- 05
The Pit, Respawn and the HUD
Window edges, falling out of the world, one respawn() for every fresh life, and the controls on screen.
- 06
Skeletons on Patrol
Something that moves without you pressing a key — and a one-point probe that keeps it off the ledge.
- 07
Health, Mercy and the Bar
100 hit points, a one-second mercy window measured with
dt, and a bar that blinks. - 08
Capstone — Make the Platformer Yours
Coins, stomping and coyote time, then playtest it on somebody else and ship it.