BLIT386BLIT386

Skill: Run the game

Start the BLIT386 dev server and open the game in a browser. Use this whenever the user wants to run, start, launch, or preview the game, see what it looks...

Written for blit386 1.8.0. The rest of blit386.dev documents the newest engine, so an API you find there may be missing from a game pinned to 1.8.0.

Start the BLIT386 dev server and open the game in a browser.

When to use

Use this when you need to run the game to test a change, or when the user says "run the game", "start the server", or "show me what this looks like."

Steps

  1. In the project folder, run npm run dev (or npx blit run).
  2. The dev server does not open a browser. Open http://localhost:5173 (or the next free port it prints).
  3. Edit and save - with the starter's blit386 Vite plugin, most code and public/ asset edits keep the game running (hot reload) instead of wiping state. Full detail: docs/hot-reload.md. There is no need to restart the server after each edit.
  4. To stop the server: press Ctrl+C in the terminal.

Notes

  • If the port is in use, read docs/when-something-breaks.md for the "port already in use" fix.
  • The dev server never opens a browser itself; use the address it printed in the terminal (http://localhost:5173 unless that port was taken).
  • If your editor has a built-in preview pane that reads .claude/launch.json (the Claude desktop app does), it can start the game and show it there, with no terminal step. That file is yours to edit, for example to change the port.
  • The game works without WebGPU (the engine falls back to Canvas 2D), so it runs in any modern browser.
  • Older project, and every save full-reloads the page? Run npx blit migrate --write (blit386 1.4.0+) to wire the plugin into vite.config, then restart once.

On this page