Stompede

A side-scrolling platformer engine with the feel of classic 8-bit platformers: exact, frame-by-frame movement at 60 updates per second, whole pixels on screen.

The engine plays content packs. It comes with a built-in pack, and it can import an NES platformer ROM that you own into a pack on your machine, so the game looks like that original. Nothing imported is part of this repository or of the program.

Playing

Start stompede. The start screen offers a new game, continuing at the start of the level you left, the settings, importing a ROM, and quitting. After a pack's last level every new game is its expert run, where the pack has one; the start screen then picks the world it begins at (left and right on its entry).

Keys: arrows or WASD move, X or space jump, Z or shift run, Enter is start, Esc opens the pause menu, F11 switches the full screen on and off. Gamepads work too, also plugged in during play: the cross and the left stick move, the lower face button jumps, the left one runs, start is start.

In the menus up and down choose an entry, left and right change its value, jump or start takes it, run or Esc goes back. Start or Esc in play pauses the game and opens the pause menu: resume, the settings, or back to the start screen (the progress stays as when you quit).

Settings

Every change takes effect at once and is saved.

  • View: the classic one, 256 px wide, or the wide one, widened on both sides; its width goes from 320 to 560 px (426 for 16:9).
  • Scale: the window's size in whole multiples of the picture, up to what fits the screen. The window also takes any size by hand; the picture then grows by whole multiples, centred on black.
  • Full screen, on or off.
  • Status bar: the pack's own layout, or a modern one: one row of numbers (the score, the coins, world and level, the clock).
  • Controls: choose a button, then press the key or pad button for it; it replaces that button's keys, or its pad buttons. Defaults brings back the keys and pad buttons above.
  • Lives: by default there is no game over and lives only count for the score; classic lives end the game when none are left.
  • Slow mode: the game at 75 % or 50 % of its speed, the sound at its pitch.
  • Volume, 0 to 100 %.

Importing your own ROM

Three ways, each makes a pack from the ROM on your machine and offers it on the start screen:

  • "Import a ROM" on the start screen opens a file dialog.
  • Drop the ROM file on the window.
  • stompede --import game.nes imports it, then plays.

The importer accepts only the version it supports and says so for any other file; nothing is written for it.

Where things are kept

The data directory is $XDG_DATA_HOME/stompede or ~/.local/share/stompede on Linux, %APPDATA%\stompede on Windows, ~/Library/Application Support/stompede on macOS; --data <dir> names another one. In it: imported packs in packs/<name>/, the settings in settings.zon (the bindings too: each button's keys and pad buttons by name), and each pack's progress in saves/: the levels reached, the best time of each level, whether the last level is beaten. The game saves at a level's end, when you go back to the start screen and when you quit, never inside a level.

Without other choices the game plays the first imported pack by name, if there is one, else the built-in pack.

Switches

stompede --pack <dir>        # play the pack in a directory
stompede --continue          # go on at the start of the level you left
stompede --expert <world>    # the expert run from that world

The switches for the settings hold for one run and change no saved setting: --lives (classic lives), --slow 75 or --slow 50, --view wide, --wide <px> (256 to 560), --status modern, --fullscreen, and --no-blend, which shows each update as it is instead of drawing the moments between updates (smooth on screens faster than 60 Hz).

Without a window (for checks): --script <text or file> plays a list of held buttons and frame counts (r right, l left, u up, d down, j jump, x run, though the X key jumps, s start, n nothing; b and f make the player big or fire in the token's first update, t shows the start screen and m presses Esc: n10 rx60 rxj20), --shot <out.png> saves the last frame, --map <out.png> the whole area, and --area <n> picks the pack's area. --gallery <out.png> saves every picture of the pack in the area's colours. --sound <name> prints what an effect, a track (death, hurry, ...) or an area's track (area<n>) writes to the sound chip, frame by frame, for --frames <n> frames (600); with --wav <out.wav> it saves the sound instead.

zig build color-swatch -- <out.png> [hue saturation contrast gamma] shows the console colours an import uses.

Building

Needs Zig 0.17. SDL3 is fetched and built by the Zig build.

zig build                # the game: zig-out/bin/stompede
zig build run            # build and start it
zig build test           # the tests
zig build release        # archives for Linux and Windows (x86_64)

The release step builds both programs (ReleaseSafe) and packs each with this guide, the licence and the credits into zig-out/release/; it needs bsdtar (libarchive).

Licence

MIT, see LICENSE. The built-in pack's pictures and music by others are CC0 1.0; content/CREDITS.md names each work, its author and its page.

S
Description
Run, jump and stomp through a frosty forest, ticking clockworks, the open sky and a clanking keep. A pixel-perfect platformer with its own world and room for many more.
Readme MIT
3.2 MiB
0 Stars 1 Watchers 0 Forks
2026-11-04 17:15:57 +01:00
Languages
Zig 100%