Repolode
kaplayjs

kaplayjs/kaplay

A fun-first 2D game library for JavaScript and TypeScript that provides a component-based API for building games in the browser.

Stars
1,825
Forks
128
Open issues
73
Last commit
2 days ago

What is it?

KAPLAY is a 2D game library for JavaScript and TypeScript. Game objects are assembled from components such as sprites, rectangles, colliders, physics bodies and health, and behaviors are attached through simple imperative calls like collision handlers and per-frame updates keyed by tags.

It can be installed from npm, set up with the create-kaplay scaffolding command, or loaded directly in the browser from a CDN. TypeScript users can opt into global types or import types from the package as a module.

The project also offers KAPLAYGROUND, a web-based editor for trying code instantly, along with a set of more than 90 examples and official documentation for learning.

Key features

  • 01Game objects composed from reusable components like sprites, colliders and physics bodies.
  • 02Event-style helpers for collisions, key presses and per-frame updates filtered by tag.
  • 03Web-based editor KAPLAYGROUND for trying code without local setup.
  • 04Available via npm, pnpm, yarn, bun, or a direct browser script include.
  • 05Full TypeScript type definitions, with optional global types.

Use cases

  • Building small 2D browser games and prototypes quickly.
  • Learning game development with JavaScript or TypeScript through the bundled examples.
  • Making game jam entries that run in a web page.

Quick start

  1. 1

    Scaffold a new game with create-kaplay

    npx create-kaplay my-game
  2. 2

    Or install KAPLAY into an existing project with npm

    npm install kaplay

Things to know

  • Using KAPLAY in your own project requires a bundler such as Vite or ESBuild.

In collections

Topics

FAQ

What is kaplay?
A fun-first 2D game library for JavaScript and TypeScript that provides a component-based API for building games in the browser. KAPLAY is a 2D game library for JavaScript and TypeScript. Game objects are assembled from components such as sprites, rectangles, colliders, physics bodies and health, and behaviors are attached through simple imperative calls like collision handlers and per-frame updates keyed by tags.
Is kaplay free to use? What license does it have?
kaplay is open source under the MIT license. Check the license terms before using it in commercial products.
Is kaplay still maintained?
Actively maintained. The last commit to kaplay was on Nov 6, 2026.
What can I use kaplay for?
Building small 2D browser games and prototypes quickly. Learning game development with JavaScript or TypeScript through the bundled examples. Making game jam entries that run in a web page.
How do I install kaplay?
Scaffold a new game with create-kaplay: npx create-kaplay my-game Or install KAPLAY into an existing project with npm: npm install kaplay
Where can I get kaplay?
The source code and installation instructions are on GitHub: https://github.com/kaplayjs/kaplay

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects