Plugins
BUILDNANA uses a flexible plugin system that helps you extend the library’s functionality with new methods, constants, or even new components.
Let’s take a look at how the default plugin myPlugin() is implemented.
// k is the BUILDNANA context, what buildnana() returns
function myPlugin(k) {
return {
hi() {
k.debug.log("Hi from myPlugin!");
},
};
} Now you can use the plugin in your game:
const k = buildnana({
plugins: [myPlugin],
});
k.hi(); // from myPlugin Creating a plugin
We recommend using our templates:
buildnana-plugin-templatebuildnana-plugin-template-ts(for TypeScript)
Both are minimal and simple templates for create and publish plugins on NPM.
Browse Plugins
Community Plugins
- kaplanck - Plank.js physics for BUILDNANA
- buildnana-rapier-physics Rapier physics for BUILDNANA
You can explore all plugins made by the community on npm or GitHub.