Skip to content

makeObject

makeObject(opt): GameObj<BaseComps>

Make an object with the base components.

Parameters

ParameterType
optObjOpt

Returns

GameObj<BaseComps>

Example

// Good for parent objects!
const myParent = k.add(makeObject({
pos: k.vec2(100, 100),
});
myParent.add(k.makeSprite({
sprite: "bean",
}));

Source

global.d.ts:3