AI-assisted HTML5 game-making with LittleJS — starter templates, helper modules, and prompts. Home of the LittleJS Arcade: 50+ games built with these tools.
LittleJS is a fast, lightweight, and fully open source HTML5 game engine designed for simplicity and performance.
This repo is the AI-assisted LittleJS toolkit:
- starter templates you can fork and remix
- helper modules for menus, sound/FX, sprites, and live tweaking
- docs and prompts to improve LittleJS + AI workflows
The finished games built with these tools live in the LittleJS Arcade (repo).
Want to make a game without writing code? Try the LittleJS GPT!
For advanced users, LittleJS also works great with tools like GitHub Copilot, Codex, and Cursor.
LittleJS and everything in this repository is MIT licensed! See LICENSE for details.
- LittleJS Engine — the main LittleJS repository
- LittleJS Arcade — 50+ finished games built with these templates (repo)
- Templates Folder — starting templates and reusable components
- LittleJS GPT AI — use ChatGPT to make games without writing any code
Clone the repo and you have everything you need to build games — from quick prototypes to large, multi-file projects. No external assets and no dependencies to play; the only npm packages are optional build tools.
- Copy the starter folder games/emptyGame/ to
games/<yourGame>/. - Edit
game.js— and add more files (player.js,ui.js,constants.js, …) as the game grows. - Open
index.htmlin a web browser. That's it — it runs straight fromfile://, no server needed.
Games use the global LittleJS API: load dist/littlejs.js with a plain <script> tag and call globals like engineInit, drawText, and vec2 directly. Keep gameplay modular across several .js files for medium and large games.
Each game folder includes a build.mjs that concatenates the engine + your source, minifies it, and produces one self-contained index.html plus a .zip (great for game jams).
npm install # once, in the repo root — installs terser + bestzip
node games/<yourGame>/build.mjs # builds games/<yourGame>/build/ and <name>.zipSingle-file references to copy patterns from when adding a feature — not full game scaffolds:
- game.html — minimal scaffold (shapes, text, camera)
- boardGame.html — grid-based games (chess, sokoban, match-3)
- menuGame.html — title, pause, options, medals, HUD toolbar
- box2dGame.html — Box2D physics (pool, plinko, pinball)
- textureGame.html — procedural sprite atlases from canvas draw ops
- tweakableGame.html — live-tweak globals via an HTML slider overlay
- uiGame.html — canvas-drawn UI (menus, sliders, dialogs)
Mix in helper scripts to add features: menus.js (DOM menus + best score + game-over dialog + setPlaying/quitToTitle), gameFx.js (procedural SFX + screen shake), textureGenerator.js (sprite painter), tweakables.js (live value tweaking).
Playable demos you can fork as starting points for your own games.
Did you make a game you think should be included? Send a pull request!
- 🧩 Tetrix
- 🤖 Robo Rescue
- 🐸 Froggit
- 🧛 Emoji Survivors
- 🏙️ Missile Defense
- ⛳ Mini Golf
- 🎱 Pool
- 🃏 Freecell
- 👾 Space Intruders
- 👻 Puc-Man
- 🌑 Asterblast
- 🔴 Checkers
- 🐛 Centibug
- 🪐 Orbitswarm
- 💊 Dr. Pill