Build a Game
Start here to build a BLIT386 game from an empty folder: the starter template, AGENTS.md, kit guides, skills, and examples.
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.
Everything needed to write a BLIT386 game from scratch, with no project on disk yet. Every page here can be read through the blit386-docs MCP server: find it with search_docs, read it with get_doc_page.
Quickest start
npm create blit386@latest my-game creates the whole project, with these same guides, skills, and rules already on disk.
Without the scaffolder
- Write the four files on the Starter Template page into an empty folder.
- Run
npm install, thennpm run dev. - Read AGENTS.md - the rules every BLIT386 game follows.
- Replace the starter game in
src/game.jswith your own, using the skills below for each feature.
Kit guides
In a scaffolded game these are the files in docs/.
- Sound and music
- Basics: the game loop
- Drawing
- Getting started
- Hot reload: keep playing while you edit
- Input
- Colors and the palette
- Random numbers and world generation
- When something breaks
Skills
One task each. In a scaffolded game they live in .claude/skills/.
- Skill: Add a CRT or post-process effect
- Skill: Add a sprite
- Skill: Add text
- Skill: Animate the palette
- Skill: Ask the docs
- Skill: Design your own sound
- Skill: Draw a panel
- Skill: Draw shapes
- Skill: Fix a runtime error
- Skill: Keep it fast
- Skill: Update BLIT386 API names
- Skill: Move and time things
- Skill: Play a sound
- Skill: Read a gamepad
- Skill: Read the keyboard
- Skill: Read the mouse, touch, and pen
- Skill: Run the game
- Skill: Save a screenshot
- Skill: Scroll with a camera
- Skill: Share the game
- Skill: Show a loading screen
- Skill: Show the debug overlay
- Skill: Smooth the motion
- Skill: Structure a game
- Skill: Test the game
- Skill: Use dev mode
- Skill: Use hot reload
- Skill: Use noise
- Skill: Use the palette (colors)
- Skill: Use random
Rules
Examples
Programs from the demo site, each running live at demos.blit386.dev. Most call demo-site helpers from ./shared/ and are not standalone; each page says what it needs. The full set of demos is at https://demos.blit386.dev.
- Example: Hello World
- Example: Basics
- Example: Primitives
- Example: Camera
- Example: Sprites
- Example: Animation
- Example: Tilemap
- Example: Palette Cycling
- Example: Pointer Basics
- Example: Keyboard Input
- Example: Snake Game
- Example: Gamepad Input
- Example: Audio Basics
- Example: Synth Toy
- Example: Random Basics