
The fun and open source game library for HTML5 Games
KAPLAY (/ˈkæpleɪ/) is a JavaScript and TypeScript game library that makes it easy to create games for the web. It's free, open-source and fun.
An enjoyable API based on blocks
KAPLAY 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
kaplay({
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)
Voices of KAPLAYers
Don't just take our word for it, see what our users say about
KAPLAY! We're proud to have such a great
community.
to be a part of it!
Join our Discord
Endel @endel
Colyseus.io, Brawlball.io & Mazmorra.io creator
KAPLAY API is incredibly intuitive and easy to read. I love how it combines simplicity with power, it’s a truly innovative library that brings HTML5 games to life!
Isaac Pante @ipante
Game Designer & College Teacher
KAPLAY is the best framework to teach programming and create fast and furious video games. We already won three awards with it, and counting!
JSLegend @jslegenddev
JavaScript content creator
KAPLAY has a very intuitive and easy to use API that makes gamedev a breeze compared to other alternatives.
Amy @amyspark-ng
Clickery Hexagon's developer
The development of KAPLAY has allowed me to make Clickery an awesome game.
niceEli @niceEli
Developer
KAPLAY is one of the best libraries for TypeScript I’ve tried. It’s a very simple API yet very powerful.