{"id":13484896,"url":"https://github.com/kaplayjs/kaplay","last_synced_at":"2026-04-01T18:11:13.471Z","repository":{"id":240957627,"uuid":"803898449","full_name":"kaplayjs/kaplay","owner":"kaplayjs","description":"🦖 A JavaScript/TypeScript Game Library that feels like a game.","archived":false,"fork":false,"pushed_at":"2026-03-25T01:10:52.000Z","size":81562,"stargazers_count":1501,"open_issues_count":78,"forks_count":102,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-03-25T21:01:11.696Z","etag":null,"topics":["game-dev","game-development","game-engine","game-library","javascript","kaboom-js","kaboomjs","typescript"],"latest_commit_sha":null,"homepage":"https://kaplayjs.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaplayjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["kaplayjs"],"patreon":null,"open_collective":"kaplay","ko_fi":"kaplay","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2024-05-21T15:14:33.000Z","updated_at":"2026-03-25T01:10:56.000Z","dependencies_parsed_at":"2024-05-28T02:21:40.925Z","dependency_job_id":"47224b3d-fbd7-4940-89ff-f2e665dd2dbb","html_url":"https://github.com/kaplayjs/kaplay","commit_stats":{"total_commits":2031,"total_committers":77,"mean_commits":"26.376623376623378","dds":"0.28261939931068436","last_synced_commit":"fd369427fd946cd155b312502d5b59b442c43446"},"previous_names":["marklovers/kaboom","marklovers/kaplay","kaplayjs/kaplay"],"tags_count":62,"template":false,"template_full_name":null,"purl":"pkg:github/kaplayjs/kaplay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaplayjs%2Fkaplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaplayjs%2Fkaplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaplayjs%2Fkaplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaplayjs%2Fkaplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaplayjs","download_url":"https://codeload.github.com/kaplayjs/kaplay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaplayjs%2Fkaplay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-dev","game-development","game-engine","game-library","javascript","kaboom-js","kaboomjs","typescript"],"created_at":"2024-07-31T17:01:38.038Z","updated_at":"2026-04-01T18:11:13.464Z","avatar_url":"https://github.com/kaplayjs.png","language":"TypeScript","readme":"# 🎮 KAPLAY.js — A JavaScript \u0026 TypeScript Game Library\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./kaplay.webp\"\u003e\n\u003c/div\u003e\n\nKAPLAY is the **fun-first**, 2D game library for **JavaScript** and\n**TypeScript**. It’s made to **feel like a game** while you're making games.\nSimple. Fast. Powerful.\n\n✨ Whether you’re a beginner or an experienced dev, **KAPLAY** comes with its\nown **web-based editor** — the [KAPLAYGROUND](https://play.kaplayjs.com) — so\nyou can try code instantly, and learn with more than **90 examples**!\n\n## 🎲 Quick Overview\n\n```js\n// Start a game\nkaplay({\n    background: \"#6d80fa\",\n});\n\n// Load an image\nloadSprite(\"bean\", \"https://play.kaplayjs.com/bean.png\");\n\n// Add a sprite to the scene\nadd([\n    sprite(\"bean\"), // it renders as a sprite\n]);\n```\n\nGame objects are composed from simple, powerful components:\n\n```js\n// Add a Game Obj to the scene from a list of components\nconst player = add([\n    rect(40, 40), // it renders as a rectangle\n    pos(100, 200), // it has a position (coordinates)\n    area(), // it has a collider\n    body(), // it is a physical body which will respond to physics\n    health(8), // it has 8 health points\n    // Give it tags for easier group behaviors\n    \"friendly\",\n    // Give plain objects fields for associated data\n    {\n        dir: vec2(-1, 0),\n        dead: false,\n        speed: 240,\n    },\n]);\n```\n\nBlocky imperative syntax for describing behaviors\n\n```js\n// .onCollide() comes from \"area\" component\nplayer.onCollide(\"enemy\", () =\u003e {\n    // .hp comes from \"health\" component\n    player.hp--;\n});\n\n// check fall death\nplayer.onUpdate(() =\u003e {\n    if (player.pos.y \u003e= height()) {\n        destroy(player);\n    }\n});\n\n// All objects with tag \"enemy\" will move to the left\nonUpdate(\"enemy\", (enemy) =\u003e {\n    enemy.move(-400, 0);\n});\n\n// move up 100 pixels per second every frame when \"w\" key is held down\nonKeyDown(\"w\", () =\u003e {\n    player.move(0, 100);\n});\n```\n\n## 🖥️ Installation\n\n### 🚀 Using `create-kaplay`\n\nThe fastest way to get started:\n\n```sh\nnpx create-kaplay my-game\n```\n\nThen open [http://localhost:5173](http://localhost:5173) and edit `src/game.js`.\n\n### 📦 Install with package manager\n\n```sh\nnpm install kaplay\n```\n\n```sh\nyarn add kaplay\n```\n\n```sh\npnpm add kaplay\n```\n\n```sh\nbun add kaplay\n```\n\n\u003e You will need a bundler like [Vite](https://vitejs.dev/) or\n\u003e [ESBuild](https://esbuild.github.io/) to use KAPLAY in your project. Learn how\n\u003e to setup ESbuild\n\u003e [here](https://kaplayjs.com/guides/install/#setup-your-own-nodejs-environment).\n\n### 🌐 Use in Browser\n\nInclude via CDN:\n\n```html\n\u003cscript src=\"https://unpkg.com/kaplay@3001.0.12/dist/kaplay.js\"\u003e\u003c/script\u003e\n```\n\n### 📜 TypeScript Global Types\n\nIf you're using **TypeScript**, you used `create-kaplay` or installed with a\npackage manager and you want **global types**, you can load them using the\nfollowing directive:\n\n```ts\nimport \"kaplay/global\";\n\nvec2(10, 10); // typed!\n```\n\nBut it's recommended to use `tsconfig.json` to include the types:\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"./node_modules/kaplay/dist/declaration/global.d.ts\"]\n  }\n}\n```\n\n\u003e [!WARNING]\\\n\u003e If you are publishing a game (and not testing/learning) maybe you don't want\n\u003e to use globals,\n\u003e [see why](https://kaplayjs.com/guides/optimization/#avoid-global-namespace).\n\nYou can also use all **KAPLAY** source types importing them:\n\n```js\nimport type { TextCompOpt } from \"kaplay\"\nimport type * as KA from \"kaplay\" // if you prefer a namespace-like import\n\ninterface MyTextCompOpt extends KA.TextCompOpt {\n  fallback: string;\n}\n```\n\n## 📚 Resources\n\n### 📖 Docs\n\n- [KAPLAY Official Docs](https://kaplayjs.com/docs/)\n- [KAPLAYGROUND](https://play.kaplayjs.com)\n\n### 📺 Tutorials\n\n- 🎥\n  [KAPLAY Library Crash Course by JSLegend ⚔️](https://www.youtube.com/watch?v=FdEYxGoy5_c)\n- 📖\n  [Learn JavaScript basics and KAPLAY to make games quickly](https://jslegenddev.substack.com/p/learn-the-basics-of-javascript-and)\n\n### 💬 Community\n\n- [Discord Server](https://discord.gg/aQ6RuQm3TF)\n- [GitHub Discussions](https://github.com/kaplayjs/kaplay/discussions)\n- [Twitter](https://twitter.com/Kaboomjs)\n\n## 🎮 Games\n\nCollections of games made with KAPLAY, selected by KAPLAY:\n\n- [Itch.io](https://itch.io/c/4494863/kag-collection)\n- [Newgrounds.com](https://www.newgrounds.com/playlist/379920/kaplay-games)\n\n## 🙌 Credits\n\nKAPLAY is an open-source project, maintained by the\n[KAPLAY Team and core contributors](https://github.com/kaplayjs/kaplay/wiki/Development-Team)\nand with the support of many\n[other amazing contributors](https://github.com/kaplayjs/kaplay/graphs/contributors).\n\n### 🏆 Recognitions\n\n- Thanks to [mulfok](https://twitter.com/MulfoK) for the awesome\n  [mulfok32](https://lospec.com/palette-list/mulfok32) color palette, used in\n  KAPLAY sprites and art\n- Thanks to [Pixabay](https://pixabay.com/users/pixabay-1/) for the great\n  [burp](https://pixabay.com/sound-effects/burp-104984/) sound, used in `burp()`\n  function\n- Thanks to [Kenney](https://kenney.nl/) for all used assets for examples\n  - [Impact Sound Pack](https://kenney.nl/assets/impact-sounds)\n  - [1-Bit Platformer Pack](https://kenney.nl/assets/1-bit-platformer-pack)\n- Thanks to [abrudz](https://github.com/abrudz) for the amazing\n  [APL386 font](https://abrudz.github.io/APL386/)\n- Thanks to [Polyducks](http://polyducks.co.uk/) for the amazing\n  [kitchen sink font](https://polyducks.itch.io/kitchen-sink-textmode-font) font\n- Thanks to [0x72](https://0x72.itch.io/) for the amazing\n  [Dungeon Tileset](https://0x72.itch.io/dungeontileset-ii)\n- Thanks to @Minamotion for the `tiny` character sprite used in some of the\n  tests\n","funding_links":["https://github.com/sponsors/kaplayjs","https://opencollective.com/kaplay","https://ko-fi.com/kaplay"],"categories":["TypeScript","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaplayjs%2Fkaplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaplayjs%2Fkaplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaplayjs%2Fkaplay/lists"}