Docs & Guides

Everything you need to ship your first HTML5 game with BOOMKIT — install, a minimal game, and the block philosophy.

GUIDE

1 · Install

BOOMKIT is a single package with zero dependencies. npm, a CDN, or just a script tag:

# npm
npm install boomkit

# or CDN
<script src="https://cdn.boomkit.dev/boomkit.js"></script>
GUIDE

2 · Your first game

Boot the engine and add a player. That's the whole skeleton:

import boomkit from "boomkit";

boomkit();

const bomb = add([
  sprite("bomb"),
  pos(center()),
  body(),
]);
CORE IDEA

3 · Blocks, not classes

Everything is a block: small pieces of behavior you attach to a game object. Combine them however you like — sprite(), pos(), body(), area(), health() — and BOOMKIT composes them for you.

Custom blocks are just functions that return an object. Write one, reuse it everywhere:

const explodeOnTouch = () => ({
  id: "explosive",
  onCollide() { destroy(this); addKaboom(this.pos); },
});
CORE IDEA

4 · TypeScript friendly

BOOMKIT is written in TypeScript and ships its own types. Your blocks get autocompletion, your game objects get typed events — no config, no generation step.

const bomb = add([
  sprite("bomb"),
  pos(center()),
  area(),
  "player", // tag
]);

bomb.onCollide("enemy", (e) => {
  bomb.hurt(1);
});
API REFERENCE

API Reference

Core functions of the block API. This list grows fast — the full reference ships with the package.

boomkit(opts) — boot the game

add(blocks) — spawn a game object

pos(x, y) — position block

sprite(name) — sprite block

body() / area() — physics & collisions

setGravity(v) — world gravity

onCollide(tag, fn) — collision events

shake(n) / flash(color, t) — juice

debug.log(msg) — in-game console

play(sound) — audio block

health(n) / hurt(n) — HP

destroy(obj) — remove an object