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
- In the project folder, run
npm run dev(ornpx blit run). - The dev server does not open a browser. Open
http://localhost:5173(or the next free port it prints). - Edit and save - with the starter's
blit386Vite plugin, most code andpublic/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. - To stop the server: press
Ctrl+Cin the terminal.
Notes
- If the port is in use, read
docs/when-something-breaks.mdfor the "port already in use" fix. - The dev server never opens a browser itself; use the address it printed in the terminal (
http://localhost:5173unless 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 intovite.config, then restart once.
Skill: Read the mouse, touch, and pen
Read mouse, touch, and pen input through BLIT386's unified pointer API with up to four slots. Use for clicking, dragging, painting, aiming, scrolling, or...
Skill: Save a screenshot
Capture the rendered frame as a PNG, either downloading it or getting a Blob. Use for a screenshot button, a 'share my creation' feature, or exporting...