Plugins for debuff, the TypeScript framework for small, polished 2D web games. This repo holds the official plugins and the list of community ones.
npm install @debuffjp/plugin-achievementsimport { achievements } from "@debuffjp/plugin-achievements";
const trophies = achievements({ list: [{ id: "FIRST_COIN", title: "First coin", when: { event: "coin" } }] });
game.use(trophies);
game.emit("coin"); // unlocked, saved, and visible to `debuff inspect`| Package | What it does | Source |
|---|---|---|
@debuffjp/plugin-achievements |
Achievements unlocked by game events, saved locally, readable by tools and platform adapters | plugins/achievements |
@debuffjp/plugin-analytics |
Batched gameplay analytics (scenes, events, errors) sent to any endpoint you choose | plugins/analytics |
@debuffjp/plugin-announce |
Screen reader announcements for canvas games through an ARIA live region | plugins/announce |
None yet. Yours could be first: see Add your plugin.
Anyone can list a plugin here. Open a pull request that adds an entry to community.json:
{
"name": "debuff-plugin-screenshake",
"description": "Trauma-based screen shake with params you can tune live",
"repo": "https://github.com/you/debuff-plugin-screenshake",
"author": "you",
"kinds": ["runtime"]
}Then run npm run registry to update the tables above, and npm run check.
To be listed, a plugin needs to:
- Be published to npm as
debuff-plugin-<name>or@scope/debuff-plugin-<name>, with thedebuff-pluginkeyword. - Follow the plugin rules: named after itself, cleans up fully on
game.dispose(), no monkey-patching, dev-only code behindimport.meta.env.DEV. - Have a README with an install line and a working example.
Listing isn't an endorsement or a review. We check the rules above and that the package installs. Kind is runtime for browser plugins (game.use), tooling for debuff.config.ts plugins (asset importers, CLI commands, scenario steps), or both.
Writing your first one? Start from the plugin guide, copy the smallest plugin in plugins/, and ask in the Discord.
npm install
npm run check # lint, build, test, registryOfficial plugins live in plugins/<name> and publish as @debuffjp/plugin-<name>. They depend only on the published @debuffjp/core, the same way a community plugin would.
MIT licence.