{"id":13406660,"url":"https://github.com/replit/kaboom","last_synced_at":"2025-12-30T06:05:55.797Z","repository":{"id":37005913,"uuid":"323439605","full_name":"replit/kaboom","owner":"replit","description":"💥 JavaScript game library","archived":true,"fork":false,"pushed_at":"2024-08-04T04:55:13.000Z","size":83083,"stargazers_count":2668,"open_issues_count":55,"forks_count":225,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-03-20T23:34:26.408Z","etag":null,"topics":["fun","game","gamedev","javascript"],"latest_commit_sha":null,"homepage":"https://kaboomjs.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/replit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2020-12-21T20:21:52.000Z","updated_at":"2025-03-19T20:01:33.000Z","dependencies_parsed_at":"2024-01-05T01:29:27.050Z","dependency_job_id":"fb83a7a4-ca8c-4ea5-be06-8e330012a858","html_url":"https://github.com/replit/kaboom","commit_stats":{"total_commits":1440,"total_committers":43,"mean_commits":33.48837209302326,"dds":0.08472222222222225,"last_synced_commit":"3b1f4f296eaecc03c4b9f1f358e19a2bcdcd1fd9"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replit","download_url":"https://codeload.github.com/replit/kaboom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245131130,"owners_count":20565773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fun","game","gamedev","javascript"],"created_at":"2024-07-30T19:02:35.895Z","updated_at":"2025-12-15T04:28:13.023Z","avatar_url":"https://github.com/replit.png","language":"TypeScript","readme":"# Notice\n\nReplit no longer maintains Kaboom. You may be interested in the community fork [KaPlay](https://github.com/marklovers/kaplay).\n\n# Kaboom\n\n![kaboom](kaboom.png)\n\n[**Kaboom**](https://kaboomjs.com) is a JavaScript library that helps you make games fast and fun!\n\nStart playing around with it in the [Kaboom Playground](https://kaboomjs.com/play)\n\n## Examples\n\n```js\n// initialize context\nkaboom()\n\n// define gravity\nsetGravity(2400)\n\n// load a sprite called \"bean\"\nloadSprite(\"bean\", \"sprites/bean.png\")\n\n// compose the player game object from multiple components and add it to the game\nconst bean = add([\n    sprite(\"bean\"),\n    pos(80, 40),\n    area(),\n    body(),\n])\n\n// press space to jump\nonKeyPress(\"space\", () =\u003e {\n    // this method is provided by the \"body\" component above\n    bean.jump()\n})\n```\n\nKaboom uses a powerful component system to compose game objects and behaviors.\n\n```js\n// add a game obj to the scene from a list of component\nconst player = add([\n    // it renders as a sprite\n    sprite(\"bean\"),\n    // it has a position\n    pos(100, 200),\n    // it has a collider\n    area(),\n    // it is a physical body which will respond to physics\n    body(),\n    // it has 8 of health\n    health(8),\n    // or give it tags for easier group behaviors\n    \"player\",\n    \"friendly\",\n    // plain objects fields are directly assigned to the game obj\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    // .hurt() comes from \"health\" component\n    player.hurt(1)\n})\n\n// check fall death\nplayer.onUpdate(() =\u003e {\n    if (player.pos.y \u003e= height()) {\n        destroy(player)\n        gameOver()\n    }\n})\n\n// if 'player' onCollide with any object with tag \"enemy\", run the callback\nplayer.onCollide(\"enemy\", () =\u003e {\n    player.hp -= 1\n})\n\n// all objects with tag \"enemy\" will move towards 'player' every frame\nonUpdate(\"enemy\", (e) =\u003e {\n    e.move(player.pos.sub(e.pos).unit().scale(e.speed))\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## Usage\n\n### Start a Project With `create-kaboom`\n\nThe fastest way to start a Kaboom game is with [`create-kaboom`](https://github.com/replit/kaboom/tree/master/pkgs/create)\n\n```sh\n$ npm init kaboom mygame\n```\n\nThis will create a directory called `mygame` for you, containing all the files we need\n\n```sh\n$ cd mygame\n$ npm run dev\n```\n\nThen open http://localhost:5173 and edit `src/game.js`\n\n### Install as NPM Package\n\n```sh\n$ npm install kaboom\n```\n\n```js\nimport kaboom from \"kaboom\"\n\nkaboom()\n\nadd([\n    text(\"oh hi\"),\n    pos(80, 40),\n])\n```\n\nalso works with CommonJS\n\n```js\nconst kaboom = require(\"kaboom\")\n```\n\nNote that you'll need to use a bundler like `esbuild` or `webpack` to use Kaboom with NPM\n\n### Browser CDN\n\nThis exports a global `kaboom` function\n\n```html\n\u003cscript src=\"https://unpkg.com/kaboom@3000/dist/kaboom.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nkaboom()\n\u003c/script\u003e\n```\n\nor use with es modules\n\n```html\n\u003cscript type=\"module\"\u003e\nimport kaboom from \"https://unpkg.com/kaboom@3000/dist/kaboom.mjs\"\nkaboom()\n\u003c/script\u003e\n```\n\nworks all CDNs that supports NPM packages, e.g. jsdelivr, skypack\n\n## Documentation\n- **v3000**: https://kaboomjs.com/\n- **v2000**: https://2000.kaboomjs.com/\n- **v0.5.0**: https://legacy.kaboomjs.com/\n\n\n## Dev\n\n1. `npm install` to install dev packages\n1. `npm run dev` to start dev server\n1. go to http://localhost:8000/ and pick an example\n1. edit examples in `examples/` to test\n\nCheck out [CONTRIBUTION.md](CONTRIBUTING.md) for full info.\n\n## Community\n\n- [Discord Server](https://discord.gg/aQ6RuQm3TF)\n- [GitHub Discussions](https://github.com/replit/kaboom/discussions)\n- [Twitter](https://twitter.com/Kaboomjs)\n\n### Games\nCollection of games made with Kaboom, selected by Kaboom, [here](https://itch.io/c/2645141/made-in-kaboom).\n\n- [on Itch.io](https://itch.io/games/tag-kaboomjs)\n- [on Replit](https://replit.com/apps/kaboom)\n- [on Newgrounds](https://www.newgrounds.com/search/conduct/games?tags=kaboomjs)\n\n## Misc\n\n- This project has no relation to Activision's game [Kaboom!](https://en.wikipedia.org/wiki/Kaboom!_(video_game))\n- Thanks to [lajbel](https://lajbel.github.io/) for help building the Kaboom community\n- Thanks to [abrudz](https://github.com/abrudz) for the amazing [APL386 font](https://abrudz.github.io/APL386/)\n- Thanks to [Polyducks](http://polyducks.co.uk/) for the amazing [kitchen sink font](https://polyducks.itch.io/kitchen-sink-textmode-font) font\n- Thanks to [0x72](https://0x72.itch.io/) for the amazing [Dungeon Tileset](https://0x72.itch.io/dungeontileset-ii)\n- Thanks to [Kenney](https://kenney.nl/) for the amazing [1-Bit Platformer Pack](https://kenney.nl/assets/1-bit-platformer-pack)\n- Thanks to [mulfok](https://twitter.com/MulfoK) for the amazing [mulfok32](https://lospec.com/palette-list/mulfok32) color palette\n- Find bitmap fonts: [Oldschool PC Font](https://int10h.org/oldschool-pc-fonts)\n- Featured on [Console 50](https://console.substack.com/p/console-50)\n- Thanks to [Umayr](https://github.com/umayr) for kindly offering the \"kaboom\" npm package name\n- Please buy fireworks on [kaboom.com](http://www.kaboom.com/)\n- [How to do a KABOOM on a Trampoline](https://www.youtube.com/watch?v=3CemcWdc_Hc)\n","funding_links":[],"categories":["TypeScript","JavaScript","UI Components","javascript","Libraries"],"sub_categories":["3D and Games","JavaScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Fkaboom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplit%2Fkaboom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Fkaboom/lists"}