thecodingidiot.com

g01b-the-developer-graphical

Who Wants to Be a Game Developer? Graphical

THE STUDIO

The PS1 game had distinct screen states.

Not one continuous render — a set of discrete visual configurations, each activated when the game's internal state changed. Main Menu. Studio. Is That Your Final Answer. Right Answer. Wrong Answer. Money Tree. Win. Game Over.

Who Wants to Be a Millionaire (2000) — Main Menu
Who Wants to Be a Millionaire (2000) — Studio: question and four options
Who Wants to Be a Millionaire (2000) — Is That Your Final Answer?
Who Wants to Be a Millionaire (2000) — Right Answer

Each state had its own background colour, its own layout, its own content. These are not one screen modified in place — they are different screens entirely, drawn only when the state that owns them is active.

Who Wants to Be a Millionaire (2000) — Wrong Answer
Who Wants to Be a Millionaire (2000) — Money Tree

In g01a, tci_printf was the rendering engine. Every screen state was a different pattern of ANSI escape codes written to a file descriptor. The game logic — questions, lifelines, safe levels — was kept separate from the display deliberately. The display functions knew nothing about game rules; the game loop called them.

In g01b, SDL2[1] is the rendering engine. The game logic has not changed a line. The display layer — render.c and font.c — is entirely new. The separation built into g01a is the reason this swap is clean.

The c04 pattern — window, renderer, texture, event loop — applies here exactly. The difference is what fills the screen: not iteration counts, but character glyphs rendered from a TrueType font[2] via SDL2_ttf, placed over a solid-colour background loaded from a PNG.

The implementation pages rebuild the display layer on SDL2: the spec and data structures, bitmap font rendering, background loading, the render functions for each game state, and the new event-driven input loop. Start at Setup.

Implementation

Setup

Begin Implementation
  1. 0Setup
  2. 1The Spec
  3. 2The Font
  4. 3The Background
  5. 4The Display
  6. 5The Input
  7. 6Play It

Footnotes

  1. SDL (software) - Wikipedia

  2. TrueType - Wikipedia

  3. Oldschool PC Font Resource