Skip to content
Kiboom logo

Kaboom.js object makers made easy

The new way for creating objects in Kaboom.js, object makers as a prefab system for your game
Terminal window
npm i kiboom

Kaboom-like

Using the functional approach of Kaboom.js, kiboom plugin feels like a native part of the library.

Extendable API

Create, merge and extend your object makers for create optionable objects

Easy to use

Create your own maker functions with a few lines of code.

TypeScript Support

Full TypeScript support out of the box.

Example

example.js
// Create a enemy maker
// We create some options with defaults
const makeEnemyOpt = makeOptions(() => ({
speed: 100,
hp: 100,
}));
// We create the new maker
const makeEnemy = extendMaker(makeObject, makeEnemyOpt, (opt) => [
// here our components list
hp(opt.hp),
move(LEFT, opt.speed),
]);
// Now we can use our new maker
k.add(makeEnemy({
hp: 200, // We can override our maker options
speed: 200, // We can override our maker options
pos: vec2(100, 100), // We can modify the base options of makeObject
anchor: "topleft", // We can modify the base options of makeObject
}));