A highly optimized 2D framework for web, mobile games, and playable ads.
Examples · Tutorials · Engine source · Game template
Most valuable when size matters
All engine code is written in ES6, fully GCC typed, allowing to eliminate all dead code from your app. For example the size of the Donuts game is only 34KB gzipped for both engine and game code (GCC version).
Advanced scene graph and rendering pipeline
Dirty flag tracks scene changes and avoids unnecessary calculations and context calls. If no changes were made to the scene since last frame, no rendering will be done. Battery efficient.
Cache as bitmap
Automatically detects changes and updates bitmap cache. Allows to gain even more performance on heavy scenes and runs smoothly on old devices.
Every link below opens a runnable example.
✔️ Extra lightweight
✔️ Display Resolution Awareness
✔️ Advanced Particle System
✔️ Vector Graphics
✔️ Vector Graphics Baking
✔️ Smart Cache As Bitmap
✔️ Tweens
✔️ Message Dispatcher
✔️ Sprite Animations
✔️ Asset Manager
✔️ Advanced Font Rendering and font metrics
✔️ Texture Atlas
✔️ Input
✔️ Clipping Rectangle
✔️ Component System
✔️ Audio Support
✔️ Audio Atlases
✔️ Bitmap Fonts
✔️ Graphics
✔️ Battery Efficient
✔️ Render Texture
✔️ Arcade Physics
✔️ Texture Wrap and Repeat
✔️ Nine slice grid
✔️ GCC Ready
The game template lives in this repository under template/:
git clone https://github.com/MassiveHeights/Black
cd Black/template
npm install
npm start
Then open http://127.0.0.1:3000 in a browser.
Or install the engine on its own:
npm install black-engine
| Path | Contents |
|---|---|
src/ |
Engine source (ES6 modules) |
dist/ |
Prebuilt UMD, ES module, and minified bundles |
examples/ |
91 runnable examples across 18 categories |
assets/ |
Assets used by the examples |
docs/Tutorials/ |
Written tutorials |
template/ |
Ready-to-use game template |
site/ |
Landing page for the published site |
The examples are plain static files, but they load assets over HTTP, so they need a
local server rather than opening index.html from disk:
npx serve .
Then open http://localhost:3000/examples/.
After adding or renaming an example, regenerate the sidebar index:
npm run examples:index
npm run build # bundles into dist/ (requires Java for the GCC step)
npm run docs # regenerates docs/api/ (currently failing, see Known issues)
npm run examples:index # regenerates manifest.js and the README indexes
The API reference generator (npm run docs) does not currently run. It uses
jsdoc 3.6, which crashes on Node 23+ (util.isRegExp was removed), and still
exits non-zero on Node 20 in CI. Until it is fixed, browse the annotated source
under src/ instead. The Pages workflow publishes the site without the
API reference rather than failing the deploy.
Found a bug or have a question? Open an issue on the Issues page.
The project is also on Facebook, Discord and Telegram.
See LICENSE.md.