Game Programming Patterns
Worked examples from Robert Nystrom's
Game Programming Patterns , implemented
in C++ on top of Storm Engine v2 .
Each pattern is a self-contained example under patterns/<category>/<name>/,
with its own engine shell (Game + GameStateMachine + a PlayState),
igloo specs, and README. Categories
follow the book's structure.
Design Patterns Revisited — patterns/design/
Sequencing Patterns — patterns/sequencing/
Behavioral Patterns — patterns/behavioral/
Pattern
Status
Reference
Bytecode
🚧 planned
chapter
Subclass Sandbox
🚧 planned
chapter
Type Object
🚧 planned
chapter
Decoupling Patterns — patterns/decoupling/
Pattern
Status
Reference
Component
🚧 planned
chapter
Event Queue
🚧 planned
chapter
Service Locator
🚧 planned
chapter
Optimization Patterns — patterns/optimization/
Pattern
Status
Reference
Data Locality
🚧 planned
chapter
Dirty Flag
🚧 planned
chapter
Object Pool
🚧 planned
chapter
Spatial Partition
🚧 planned
chapter
Storm Engine v2 installed (libstormenginev2 + stormengine2 headers)
SDL2, SDL2_image, SDL2_ttf, SDL2_mixer
igloo (header-only test framework)
Each pattern builds independently from its own directory (binaries land in the
repo-root bin/):
cd patterns/design/command
make # builds the example
make run
make test # builds the igloo specs
make run-test
Copy patterns/__template__/ to patterns/<category>/<name>/.
In its Makefile, set NAME and make the include path point at the root
common.mk (../../../common.mk for a <category>/<name> folder).
Replace REPLACEME in src/game.cpp (window title) and the README
(including its reference link).
Implement the pattern in src/states/playState.cpp (and add classes under
src/), with specs under specs/.
Flip the pattern's status to ✅ above.
The shared build config lives in common.mk ; it locates the repo
root from its own path, so patterns work at any folder depth.