KAPLAY is the fun-first, 2D game library for JavaScript and TypeScript. It’s made to feel like a game while you're making games. Simple. Fast. Powerful.
✨ Whether you’re a beginner or an experienced dev, KAPLAY comes with its own web-based editor — the KAPLAYGROUND — so you can try code instantly, and learn with more than 90 examples!
Game objects are composed from simple, powerful components:
Blocky imperative syntax for describing behaviors
The fastest way to get started:
Then open http://localhost:5173 and edit src/game.js.
You will need a bundler like Vite or ESBuild to use KAPLAY in your project. Learn how to setup ESbuild here.
Include via CDN:
If you're using TypeScript, you used create-kaplay or installed with a package manager and you want global types, you can load them using the following directive:
But it's recommended to use tsconfig.json to include the types:
Warning
If you are publishing a game (and not testing/learning) maybe you don't want to use globals, see why.
You can also use all KAPLAY source types importing them:
- 🎥 KAPLAY Library Crash Course by JSLegend ⚔️
- 📖 Learn JavaScript basics and KAPLAY to make games quickly
Collections of games made with KAPLAY, selected by KAPLAY:
KAPLAY is an open-source project, maintained by the KAPLAY Team and core contributors and with the support of many other amazing contributors.
- Thanks to mulfok for the awesome mulfok32 color palette, used in KAPLAY sprites and art
- Thanks to Pixabay for the great burp sound, used in burp() function
- Thanks to Kenney for all used assets for examples
- Thanks to abrudz for the amazing APL386 font
- Thanks to Polyducks for the amazing kitchen sink font font
- Thanks to 0x72 for the amazing Dungeon Tileset