Empowering best-in-class 2D web games

## Spend the first hour on the game

Most game ideas don't die from bad design. They die in setup, somewhere between the game loop and the sound that won't play.

debuff handles the setup. Start from a template and you're already tinkering: wobble things, break them, keep what makes you grin.

## From doodle to done

StartA running game in under a minute, with a starter or a platformer.
BuildSprites, levels from Tiled and LDtk, and an asset pipeline that ships only what you use.
TuneFeel values become live sliders in the dev panel, with undo.
VerifyDeterministic scenarios drive your game in a real browser and compare screenshots.
ShipA size report that fails if dev code leaks. Web anywhere, or desktop with Tauri.

## Small codebase, big ideas

No spelunking through `game.world.systems.physics.step()`. A game is a scene with `update` and `render`, and the fun stuff is one call away.

```ts [Start]
const game = new Game({ canvas, width: 320, height: 180 });
const input = new Input(game, {
  bindings: { pop: ["Space", "PadA", "Pointer"] },
});

game.add(play).go("play");
game.start();
```

```ts [Tune]
// Too floaty? Drag the slider in the dev panel until it feels right.
const tuning = game.params.define("player", {
  speed: { type: "number", default: 140, min: 0, max: 600, units: "px/s" },
});

player.vx = approach(player.vx, dir * tuning.values.speed, accel * dt);
```

```ts [Juice]
if (input.pressed("pop")) {
  // squish, sparkle, rumble, boop
  squash(tweens, player, 0.35);
  particles.emit({ x: player.x, y: player.y, count: 16, gravity: 200 });
  game.camera.shake(0.3);
  audio.synth({ freq: 660, freqEnd: 220, decay: 0.15 });
}
```

```ts [Test]
import { expect, play, test } from "keiko";

test("never leaves the screen", async () => {
  const game = await play();
  game.press("ArrowLeft");
  game.during("3s", (s) => s.player.x >= 8, "buff stays on screen");
});
```

```json [Verify]
{
  "steps": [
    { "press": "ArrowRight" },
    { "wait": 30 },
    { "release": "ArrowRight" },
    { "expect": { "state.player.x": { "gt": 200 } } },
    { "capture": "moved" }
  ]
}
```

Build your first game · See the full examples

## The boring bits, handled

Small by defaultThe starter ships at about 19 kB brotli, and the asset pipeline bundles only what your game uses.
Errors that explain themselvesA crash stops the game cleanly and says whose bug it is (your code, a rejected call, or debuff), with the exact source line and a hint.
Dev panel that answers "why?"Pause, step, slow motion, live game state, and dropped frames attributed to your code or to something outside it.
Tests you can trustSame inputs, same game: scenarios replay exactly, so a bug comes with a reproduction instead of "works on my machine".
Web standards onlyES modules, a canvas, Web Audio and Gamepad. No proprietary editor or project format. It even runs from a CDN with no build step.

## Tools that work on their own {#tools}

debuff is made of parts you can use without it, in any engine or none.

## Play first, read later

Four games to play right here, each with its source and the docs behind it. The size on each card is its JavaScript, brotli-compressed.

▶Overbuffedswarm survival · 26 kB▶squishmatch-3 · 23 kB▶mossfelltop-down adventure · 29 kB▶platformertilemap platformer · 28 kB

See all the examples

## Bring a coding agent along, if you like

Agents are welcome and never required. With the [debuff MCP server](/docs/agents), an agent like Claude Code can play the game you have open, read its state and see why it crashed, tune params and check its changes with scenarios. Every action it takes shows up in your dev panel, and you can undo any of it.

New projects ship an `AGENTS.md` with the commands and rules, so agents start with the right context. Creative calls stay with you: the tools are built for agents to propose and people to decide.

opengame_startlookgame_stateseegame_captureplaygame_inputprofilegame_profileverifyrun_scenarios

## Made by people who make things

Built on the shoulders of Vite, Vitest, happy-dom, TypeScript, Tiled, LDtk and more open-source work. Thank you.

Contribute on GitHub · Join the Discord

## Make something . {#make-something-weird}

Build your first game Source on GitHub Ask a question Sponsor us

Sponsored by  Wavedash

.home-sections {
  --c-lime: #cffb2d;
  --c-sky: #38bdf8;
  --c-pink: #f472b6;
  --c-amber: #fbbf24;
  --c-violet: #a78bfa;
}
.c-lime { --accent: var(--c-lime); }
.c-sky { --accent: var(--c-sky); }
.c-pink { --accent: var(--c-pink); }
.c-amber { --accent: var(--c-amber); }
.c-violet { --accent: var(--c-violet); }
.home-sections {
  max-width: 1152px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}
@media (min-width: 640px) {
  .home-sections { padding: 24px 48px 80px; }
}
.home-band {
  padding: 40px 0;
  border-top: 1px solid var(--vp-c-divider);
}
.home-band h2 {
  font-family: var(--vp-font-family-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
  border: 0;
  padding: 0;
}
.home-band p {
  max-width: 46rem;
  color: var(--vp-c-text-2);
  line-height: 1.7;
  margin: 0 0 12px;
}
.home-band a:not(.card):not(.final-primary) {
  color: var(--vp-c-brand-1);
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.credits {
  display: flex;
  flex-wrap: wrap;
  padding-left: 12px;
  margin: 20px 0 12px;
}
/* Overlapping avatars that bubble up on hover. */
.vp-doc .credits a {
  margin-left: -12px;
  border-radius: 30%;
  line-height: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.vp-doc .credits a:hover,
.vp-doc .credits a:focus-visible {
  transform: translateY(-6px) scale(1.12);
  z-index: 1;
}
.credits img {
  width: 48px;
  height: 48px;
  border-radius: 30%;
  border: 3px solid var(--vp-c-bg);
  background: var(--vp-c-bg-soft);
}
@media (prefers-reduced-motion: reduce) {
  .vp-doc .credits a { transition: none; }
}
.eyebrow {
  font: 600 12px/1.4 var(--vp-font-family-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vp-c-text-2) !important;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  counter-reset: step;
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .steps li { grid-column: span 2; }
  .steps li:nth-child(n + 4) { grid-column: span 3; }
}
.steps li {
  margin: 0 !important;
  counter-increment: step;
  padding: 16px;
  border: 1px solid var(--vp-c-divider);
  border-radius: 12px;
  background: var(--vp-c-bg-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  min-width: 0;
}
.steps li strong::before {
  content: counter(step) " ";
  color: var(--accent, var(--vp-c-brand-1));
  font-family: var(--vp-font-family-mono);
}
.steps .cmd { width: 100%; min-width: 0; }
.steps span {
  color: var(--vp-c-text-2);
  font-size: 14px;
  line-height: 1.6;
}
.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--vp-c-divider);
  border-radius: 12px;
  background: var(--vp-c-bg-soft);
  text-decoration: none !important;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--vp-c-text-3); }
.card strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent, var(--vp-c-brand-1));
  vertical-align: 2px;
}
.card strong { color: var(--vp-c-text-1); font-size: 16px; }
.card span { color: var(--vp-c-text-2); font-size: 14px; line-height: 1.6; }
.home-final { text-align: left; }
.home-final h2 { font-size: 36px; }
.final-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 16px !important;
}
.final-primary {
  padding: 8px 18px;
  border-radius: 999px;
  background: #cffb2d;
  color: #11140d !important;
  font-weight: 600;
  text-decoration: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}

/* Design pass: bigger headings, game cards, the spryte band, tool chips and a lime final panel. */
.home-band h2 { font-size: 36px; }
.games {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 8px 0 4px;
}
@media (max-width: 860px) { .games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vp-doc .games a.game {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: var(--vp-c-bg-soft);
  text-decoration: none !important;
  transition: transform 0.15s;
}
.vp-doc .games a.game:hover { transform: translateY(-3px); }
.games img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  image-rendering: pixelated;
}
.vp-doc .games a.game { position: relative; }
.games span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  color: var(--vp-c-text-1);
}
.games span strong { font-weight: 600; }
.games span small { font-size: 12px; color: var(--vp-c-text-3); }
.games .play {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #cffb2d;
  color: #11140d;
  font-size: 13px;
  padding-left: 2px;
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.2s, scale 0.3s cubic-bezier(0.34, 1.8, 0.64, 1);
}
.games a.game:hover .play, .games a.game:focus-visible .play { opacity: 1; scale: 1; }
.spryte-band {
  margin: 24px 0;
  padding: 40px !important;
  border: 0 !important;
  border-radius: 24px;
  background: #11140d;
}
.spryte-band h2 { color: #cffb2d; font-family: "Chakra Petch", var(--vp-font-family-display); }
.spryte-mark { border-radius: 16px; margin-bottom: 16px; }
.spryte-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.spryte-stats div { background: #1b2014; border-radius: 16px; padding: 16px; }
.spryte-stats b { display: block; font: 700 32px/1 "Chakra Petch", var(--vp-font-family-base); color: #cffb2d; }
.spryte-stats span { display: block; margin-top: 6px; font-size: 13px; color: #9aa38c; }
.vp-doc .home-band a.spryte-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: #cffb2d;
  color: #11140d !important;
  font-weight: 600;
  text-decoration: none !important;
}
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.tools a {
  --c: #b49cf0;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, transparent) !important;
  color: var(--vp-c-text-1) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s, translate 0.25s cubic-bezier(0.34, 1.8, 0.64, 1);
}
.tools a:hover { background: color-mix(in srgb, var(--c) 28%, transparent) !important; translate: 0 -2px; }
.tools a code { padding: 0 !important; background: none !important; color: var(--c) !important; font-size: 12px !important; }
.tools .c-pink { --c: #f4a6d6; }
.tools .c-sky { --c: #1fb4ec; }
.tools .c-amber { --c: #e08a4a; }
.tools .c-violet { --c: #8f8cf0; }
.tools .c-mint { --c: #a8e8c0; }
:root:not(.dark) .tools a code { color: color-mix(in srgb, var(--c) 55%, #11140d) !important; }
.home-final {
  margin-top: 24px;
  padding: 40px !important;
  border: 0 !important;
  border-radius: 24px;
  background: #cffb2d;
}
.home-final h2 { color: #11140d; }
.home-final p { color: #11140d !important; }
.vp-doc .home-final .final-links a:not(.final-primary) { color: #11140d !important; }
.vp-doc .home-final a.final-primary { background: #11140d; color: #cffb2d !important; }
.card { border-radius: 18px; padding: 22px; }
.card strong::before { width: 10px; height: 10px; border-radius: 50%; }
.card:hover { border-color: var(--accent, var(--vp-c-text-3)); }

/* Pass 2. Homepage headings don't need the hover anchor. */
.home-band .header-anchor { display: none; }

/* From doodle to done: five equal steps joined by a line, commands pinned to the bottom. */
.vp-doc ol.steps { padding-left: 0 !important; position: relative; }
.steps li {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  padding: 20px !important;
  border-radius: 18px !important;
  position: relative;
}
.steps li strong {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}
.steps li strong::before {
  content: counter(step) !important;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #11140d !important;
  font: 700 15px/1 var(--vp-font-family-base) !important;
  flex: none;
}
.steps li > span { order: 2; }
.steps li > .cmd { order: 3; margin-top: auto; }
/* Compact commands so "npm create debuff" fits a fifth of the row. */
.steps li > .cmd { font-size: 12px; padding-left: 10px !important; padding-right: 6px !important; }
.steps li > .cmd code { white-space: normal; overflow: visible; text-overflow: clip; text-align: left; }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 14px !important; }
  .steps li, .steps li:nth-child(n + 4) { grid-column: auto !important; }
  /* the line joining the step badges */
  .steps::before {
    content: "";
    position: absolute;
    left: 40px;
    right: 40px;
    top: 35px;
    height: 2px;
    background: linear-gradient(90deg, #cffb2d, #38bdf8, #f472b6, #fbbf24, #a78bfa);
    opacity: 0.35;
  }
}
@media (max-width: 959px) {
  .steps { grid-template-columns: 1fr !important; }
  .steps li, .steps li:nth-child(n + 4) { grid-column: auto !important; }
}

/* The boring bits: an even grid, text from the top, a jelly icon tile per card. */
.cards { align-items: stretch; }
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .cards .card { grid-column: span 2; }
  .cards .card:nth-child(n + 4) { grid-column: span 3; }
}
.card {
  display: flex !important;
  flex-direction: column;
  gap: 10px !important;
  align-content: start;
}
.card strong {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px !important;
}
.card strong::before {
  /* a little jelly blob with dot eyes, in the card's colour */
  content: "" !important;
  flex: none;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  border-radius: 12px !important;
  background:
    radial-gradient(circle at 38% 46%, #11140d 0 2.4px, transparent 2.9px),
    radial-gradient(circle at 62% 46%, #11140d 0 2.4px, transparent 2.9px),
    var(--accent) !important;
  animation: bob 2.6s ease-in-out infinite;
}
.card:nth-child(2) strong::before { animation-delay: 0.3s; }
.card:nth-child(3) strong::before { animation-delay: 0.6s; }
.card:nth-child(4) strong::before { animation-delay: 0.9s; }
.card:nth-child(5) strong::before { animation-delay: 1.2s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  45% { transform: translateY(-3px) scale(0.96, 1.05); }
  60% { transform: translateY(0) scale(1.06, 0.94); }
}
@media (prefers-reduced-motion: reduce) {
  .card strong::before { animation: none; }
}

/* Pass 3: squish has no outlines. Cards are flat fills; hover lifts the fill instead of the border. */
.steps li,
.card {
  border: 0 !important;
  background: var(--vp-c-bg-soft) !important;
  transition: background-color 0.15s, transform 0.15s !important;
}
.vp-doc a.card:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--vp-c-bg-soft)) !important;
  transform: translateY(-2px);
}
/* Step commands: a borderless chip on one line, no copy icon (clicking still copies). */
.steps li > .cmd {
  border: 0 !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
  padding: 7px 12px !important;
  font-size: 11.5px;
  width: auto !important;
  align-self: flex-start;
}
.steps li > .cmd code { white-space: nowrap !important; }
.steps li > .cmd .state { display: none !important; }
/* Long titles wrap beside the icon, not under it. */
.card strong { align-items: flex-start !important; line-height: 1.3; }
.card strong::before { margin-top: -2px !important; }

/* Pass 4: the steps as a bento grid. */
.steps::before { display: none !important; }
@media (min-width: 960px) {
  .steps {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(150px, auto);
  }
  .steps li, .steps li:nth-child(n + 4) { grid-column: span 2 !important; }
  .steps li:first-child { grid-row: span 2; }
}
@media (min-width: 640px) and (max-width: 959px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .steps li:first-child { grid-column: span 2 !important; }
}