Skip to content

Maker functions

To understand the base of kiboom, you need to understand the make() function. It receives a components array like add(), but doesn’t add the object to the scene.

const bean = k.make([
k.pos(100, 100),
k.sprite("bean"),
]);
k.add(bean);

Object Maker

An Object Maker is a function that receives a configuration and returns a new fgame object using make(). It have benefits, like be extendable and modifiable. Kiboom provides a set of object makers, like makeSprite, makeText, all of thems are extended from the base maker, makeObject.

const myObject = k.makeSprite({
pos: k.vec2(100, 100), // from makeObject()
sprite: "player", // from makeSprite()
});

The maker functions will speed up your development, and make your code more cleaner, also improves modulization.