A fun game library for HTML5 Games

KAPLAY is a JavaScript game library that makes it easy to create games. It's the successor of Kaboom.JS. With KAPLAY, you can create games with a few lines of code.

KAFriend
Friendly API. Easy to learn, easy to teach.
KAFriend
A bunch of examples to get started.
KAFriend
Large community, always ready to help.
KAFriend
Open Source, free to use.
KAPLAY Banner

Do a basic platformer in less of 30 lines of code

KAFriend
kaplay(); // Starts KAPLAY
loadSprite("bean", "/sprites/bean.png"); // Load a sprite
setGravity(1600); // Set the gravity acceleration (pixels per second)

const player = add([ // add() works for adding game object
    sprite("bean"), // Add a sprite
    pos(center()), // Set the position to the center of the screen
    area(), // Add a collision area to the object
    body(), // Add physics to the object
]);

add([ // add() a platform to hold the player
    rect(width(), 48),
    outline(4),
    area(),
    pos(0, height() - 48), // Bottom of the screen
    body({ isStatic: true }), // Static body, it won't move
]);

onKeyPress("space", () => { // when space key is pressed
    if (player.isGrounded()) { // only if it's grounded
        player.jump(); // jump, given from the body() component
    }
});
KAFriend
Your game
KAFriend
KAFriend
KAFriend
KAFriend
KAFriend
KAFriend