{"id":18562474,"url":"https://github.com/replit/kaboomware","last_synced_at":"2025-04-10T03:31:54.118Z","repository":{"id":191685360,"uuid":"685126127","full_name":"replit/kaboomware","owner":"replit","description":null,"archived":true,"fork":false,"pushed_at":"2023-11-25T21:46:50.000Z","size":3332,"stargazers_count":10,"open_issues_count":3,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-08T02:16:27.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-30T15:13:10.000Z","updated_at":"2025-02-20T15:42:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"8be242ba-f2cb-4377-9188-1c4197142cc5","html_url":"https://github.com/replit/kaboomware","commit_stats":null,"previous_names":["slmjkdbtl/kaboomware","replit/kaboomware"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboomware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboomware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboomware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fkaboomware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replit","download_url":"https://codeload.github.com/replit/kaboomware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248151077,"owners_count":21056020,"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":[],"created_at":"2024-11-06T22:09:52.502Z","updated_at":"2025-04-10T03:31:49.101Z","avatar_url":"https://github.com/replit.png","language":"TypeScript","readme":"![logo](logo.png)\n\nKaboomWare is a tool for making warioware-like mini games in Kaboom.\n\n## Developing \u0026 Publishing a Mini Game\n\n1. Create a fork of the KaboomWare\n\n2. Clone your forked repo\n\n```sh\n$ git clone https://github.com/{your_github_id}/kaboomware\n```\n\n3. Install dependencies\n\n```sh\n$ npm install\n```\n\n4. Create a game with\n\n```sh\n$ npm run create {yourname}:{gamename}\n# for example\n$ npm run create wario:squeeze\n```\n\n\u003e Note: Game name has to be ASCII characters with no space\n\nThis will create a folder at `games/{yourname}/{gamename}`, with\n\n- `main.ts` - Game script\n- `assets/` - All the assets that'll be used for the game\n\n5. Run your game with\n\n```sh\n$ npm run dev {yourname}:{gamename}\n```\n\n6. Edit `games/{yourname/{gamename}/main.ts` and start developing the game!\n\nA KaboomWare game is just a plain JavaScript object:\n\n```ts\nconst squeezeGame = {\n\n    // The prompt for the game that tells player what to do. Normally it'll be just a simple verb.\n    prompt: \"Squeeze!\",\n\n    // Name of the author.\n    author: \"tga\",\n\n    // Background color hue (0.0 - 1.0).\n    hue: 0.46,\n\n    // Load assets for the game. The argument k is a limited version of the Kaboom context, only k.loadXXX() functions are enabled here.\n    onLoad: (k) =\u003e {\n        k.loadRoot(\"assets/\")\n        k.loadSound(\"fly\", \"sounds/fly.mp3\")\n        k.loadSprite(\"hand\", \"sprites/hand.png\")\n    },\n\n    // Main entry point of the game. This function should return a GameObject that contains the game. The argument k is a limited version of the Kaboom context, plus a set of KaboomWare-specific APIs (see below)\n    onStart: (k) =\u003e {\n\n        // k.add() is disabled, use k.make() to make a game object and return\n        const scene = k.make()\n\n        // All game objects are added as children of the scene game object\n        const hand = scene.add([\n            k.pos(420, 240),\n            k.sprite(\"hand\"),\n        ])\n\n        // KaboomWare only supports 1 action button and 4 directional buttons. Use the KaboomWare-specific API k.onButtonXXX()\n        k.onButtonPress(\"action\", () =\u003e {\n            hand.squeeze()\n            if (gotIt) {\n                // Tell KaboomWare player has succeeded and progress to the next game\n                k.win()\n            }\n        })\n\n        // Return the scene game object here and it'll get mounted to KaboomWare when this game starts.\n        return scene\n\n    },\n\n}\n```\n\nThe added API in `onStart()` is\n\n```ts\ntype GameAPI = {\n    // Register an event that runs once when a button is pressed.\n    onButtonPress: (btn: Button, action: () =\u003e void) =\u003e EventController,\n    // Register an event that runs once when a button is released.\n    onButtonRelease: (btn: Button, action: () =\u003e void) =\u003e EventController,\n    // Register an event that runs every frame when a button is held down.\n    onButtonDown: (btn: Button, action: () =\u003e void) =\u003e EventController,\n    // Register an event that runs once when timer runs out.\n    onTimeout: (action: () =\u003e void) =\u003e EventController,\n    // Register an event that runs once when game ends, either succeeded, failed or timed out.\n    onEnd: (action: () =\u003e void) =\u003e EventController,\n    // Run this when player succeeded in completing the game.\n    win: () =\u003e void,\n    // Run this when player failed.\n    lose: () =\u003e void,\n    // Current difficulty.\n    difficulty: 0 | 1 | 2,\n}\n\ntype Button =\n    | \"action\"\n    | \"left\"\n    | \"right\"\n    | \"up\"\n    | \"down\"\n```\n\n7. Once you finished a game, submit a PR to the [kaboomware github repo](https://github.com/slmjkdbtl/kaboomware), using the naming format: `[Game] {yourname} - {gamename}`\n\nOne PR should only contain 1 game! Normally a game PR will always go through, unless it's oibviously unplayable.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Fkaboomware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplit%2Fkaboomware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Fkaboomware/lists"}