๐๐ค LittleJS AI
June 6, 2026 ยท View on GitHub
An AI-assisted toolkit for making HTML5 games with LittleJS โ starter templates, helper modules, docs, and prompts for AI workflows. The games built with it live in the LittleJS Arcade.
๐ฎ โถ Play in the LittleJS Arcade
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 โ everything you need to build games, but not the games themselves:
- 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 50+ finished games built with these tools live in their own repo: the LittleJS Arcade (source).
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.
๐ Resources
- LittleJS Engine โ the main LittleJS repository
- LittleJS Arcade โ 50+ finished games built with these tools, in their own repo (source)
- Templates Folder โ starting templates and reusable components
- LittleJS GPT AI โ use ChatGPT to make games without writing any code
๐ ๏ธ Make Your Own
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.
Start a new game
- 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.
Ship a single-file build (optional)
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>.zip
๐ Feature templates
Single-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).
๐น๏ธ Built With These Tools
A few favorites from the LittleJS Arcade โ every one made with the templates and helpers in this repo. Fork any of them from the Arcade repo as a starting point for your own.
- ๐งฉ Tetrix
- ๐ค Pong
- ๐ค Robo Rescue
- ๐ธ Froggit
- ๐ง Emoji Survivors
- ๐๏ธ Missile Defense
- โณ Mini Golf
- ๐ฑ Pool
- ๐ Freecell
- ๐พ Space Intruders
- ๐ป Maze Munchy
- ๐ Astroblast
- ๐ด Checkers