A space combat roguelite that lives in your terminal.
Fifteen waves, three hulls and three flagships, drawn in ANSI text by 3,400 lines of Python with no dependencies. The screen here runs that same Python in your browser.
Keyboard: WASD steer, Space fire, Enter deploy. Your mouse steers too.
On a phone, fly with the pad under the screen. Auto-fire starts on. Turn sideways for a wider view.
pipx install git+https://github.com/fortunexbt/terminal-starfield
Nothing was ported
The browser build copies the nine modules in terminal_starfield/ into Pyodide, CPython compiled to WebAssembly, and runs them in a Web Worker. A 30-line BrowserTTY class stands in for the terminal session. It hands keystrokes from xterm.js to the game's own escape-sequence decoder and sends back the ANSI frame the game would have written to your TTY.
- xterm.jskeys and mouse as bytes
- KeyDecoder.feed()arrows, SGR mouse, Esc
- Flight.step()120 Hz fixed-step simulation
- Renderer.frame()24-bit ANSI, Braille subcells
- xterm.jsrepaints the rows that changed
Finished campaign and endless runs go into the game's own flight log, which this page keeps in your browser's storage, so the flight deck remembers your best score.
Flight controls
- WASD
- Steer the flight vector. On the flight deck, pick a hull and a mode.
- Enter
- Deploy from the flight deck
- Space
- Fire photons. Shots build heat.
- F
- Auto-fire while a target is in the sight
- M
- Launch a seeker at a locked target
- E
- Nova: clears nearby plasma, costs 35 energy
- B
- Boost
- ↑↓
- Throttle
- 1–6
- Pick upgrades, refit services and routes
- I H P
- Ship systems, manual, pause
- Q
- Quit to the shell
- Mouse
- Point to steer, click to fire, right-click for a seeker, wheel for throttle
Play it where it belongs
Python 3.9 or newer on macOS, Linux or Windows through WSL. Any terminal with 24-bit colour shows the full artwork, and --ascii covers the rest.
$ pipx install git+https://github.com/fortunexbt/terminal-starfield
$ starfield
$ starfield --demo
$ starfield --mode endless --seed 7 --mouse