Skip to main content

DOOM Overlay Demo

Play DOOM as an overlay in pi. Demonstrates that the overlay system can handle real-time game rendering at 35 FPS.

Usage

pi --extension ./examples/extensions/doom-overlay

Then run:

/doom-overlay

The shareware WAD file (~4MB) is auto-downloaded on first run.

Controls

ActionKeys
MoveWASD or Arrow Keys
RunShift + WASD
FireF or Ctrl
Use/OpenSpace
Weapons1-7
MapTab
MenuEscape
Pause/QuitQ

How It Works

DOOM runs as WebAssembly compiled from doomgeneric. Each frame is rendered using half-block characters (▀) with 24-bit color, where the top pixel is the foreground color and the bottom pixel is the background color.

The overlay uses:

  • width: "90%" - 90% of terminal width
  • maxHeight: "80%" - Maximum 80% of terminal height
  • anchor: "center" - Centered in terminal

Height is calculated from width to maintain DOOM's 3.2:1 aspect ratio (accounting for half-block rendering).

Credits