The fun and open source game library for HTML5 Games
BUILDNANA (/bɪldˈnænə/) is a JavaScript and TypeScript game library that makes it easy to create play-to-earn games on Solana.
An enjoyable API based on blocks
BUILDNANA is a lot of fun to use and easy to learn. It was uniquely designed with blocks and functions to make it intuitive and engaging. Just take a look at the examples below and experience it for yourself!
Start game
buildnana({
background: "darkSalmon",
debug: true,
burp: true,
// and more uselful opts, like burp is
});
debug.log("Press (B) button to burp!"); Add an object
const bean = add([
sprite("bean"),
pos(center()),
health(5),
body(), // adds physics
area(), // adds collisions
]); Kill destroy an object
setGravity(1000);
bean.jump();
bean.onCollide("spikes", () => {
bean.hurt(5);
bean.destroy();
shake(5);
flash("#cc425e", 0.2);
}); Add custom components
// returns an object
const spillTheBeans = (count) => ({
id: "chaos",
add() { /* code */ },
});
add([
spillTheBeans(30), // adds chaos :O
]); Say goodbye
const bubble = add([
anchor("center"),
pos(center()),
rect(400, 100, { radius: 8 }),
outline(4, BLACK),
]);
bubble.add([
anchor("center"),
text("ohhi, I mean.. oh bye!", {
size: 26,
}),
color(BLACK),
]); Plus many more simple and fun to use methods and functions
No more long nested methods like
obj​.position​.transform​.translate(10, 20)