Framework Patterns
Game loops, state machines, interrupts
Commodore 64
1 patternSinclair ZX Spectrum
4 patternsGame Loop (HALT)
Frame-synchronised game loop using the HALT instruction. Locks to 50Hz for consistent timing across all Spectrums.
Screen Frame (BASIC)
Draw a 1-cell border around the play area with title and footer bars. The standard game screen layout.
State Machine Loop
Organise game flow with distinct states (title, playing, game over). Clean separation of game phases.
Text Utilities (BASIC)
Centre text on any row and clear rows — two tiny subroutines used in every BASIC game.
Nintendo Entertainment System
2 patternsCommodore Amiga
2 patternsCross-Platform
5 patternsEscalation as Data
Difficulty lives in a table; a level-up pokes the next row into live tuning variables the systems read fresh every frame. The systems never learn that levels exist.
Game State Machine
Organise game flow with distinct states (title, playing, game over). Clean separation of game phases.
LFSR Random Numbers
Linear Feedback Shift Register for fast, deterministic pseudo-random numbers.
The Ending Dwell
Win or lose, the screen holds for a beat before any button is believed. The pause is the punctuation that lets the player read their own ending — and it stops a held button blowing through three screens in three frames.
Three Caps: Counter, Index, Digit
A level counter, a table index, and a HUD digit are three different numbers with three different caps. The counter never stops, the index clamps for safety, the digit caps for display — conflate them and the game lies about one of them.