Skip to content

Extending Makers

The idea of kiboom is create your own maker functions, but we provide a set of general use makers that you can use in your game.

All of them extends makeObject, there’s an introduction to the most important ones, but you can find all in the API.

makeObject()

makeObject(), creates a game object with some base transform components. Is useful for use as a parent object or for create new makers.

const myParent = k.add(makeObject({
pos: vec2(100, 100),}
));
const child = myParent.add(makeObject({
pos: vec2(50, 50), // real position: 150, 150
}));

makeRender()

Make render is another used as base maker, it extends makeObject and adds color and opacity components. I don’t recommend use it directly, but you can use it in other makers as makeSprite or makeText.

// Make a sprite
const mySprite = k.add(makeSprite({
pos: vec2(100, 100), // from makeObject
sprite: "player", // from makeSprite
color: "#ffffff", // from makeRender
opacity: 0.5, // from makeRender
}));
// Make a text
const myText = k.add(makeText({
pos: vec2(100, 100), // from makeObject
text: "Hello world!", // from makeText
color: "#fffffff", // from makeRender
opacity: 0.5, // from makeRender
}));

makeArea()

Useful for create areas, like collision areas, or areas for interact with the player.

const myArea = k.add(makeArea({
pos: vec2(100, 100), // from makeObject
width: 50, // from makeArea
height: 50, // from makeArea
}));