Making makers
kiboom has the possibility to create your own maker functions, this is a powerful feature that can save you a lot of time.
For create a maker, we recommend extend the base maker, makeObject
, so we use
the extendMaker()
function.
extendMaker(baseMaker, defaultOpt, componentsApply) | In API
baseMaker
: The base maker to extend.defaultOpt
: The default options for the new maker. You must usemakeOptions
componentsApply
: The components to apply in the new maker.
In the example above, we create a new maker called makeEnemy
, this maker
extends the makeObject
maker, and adds the hp
and move
components, and
also a speed
and hp
options.
The idea is to create a maker that is easy to use and that can be reused in
different parts of the game. Also you should extend the most useful maker for
you, it can be makeObject
, makeSprite
, makeText
, etc.