Feature Library

2D action kit

A still from Swarm run
Still
The live game starts when it’s in view.Move with WASD, the arrows, a pad or a touch stick · aim with the mouse · Space to burst · Esc to pause

A 2D action game in the browser, top-down or twin-stick: hundreds of things on screen drawn in a few instanced layers, a run shaped by waves, hits that feel like hits, a HUD that lives in the world, a pause that is a breath, and an end that makes people play again. Keys, pads and touch; a frame well under 4 ms of CPU, a lighter phone tier, Canvas 2D where there is no WebGPU.

Swarm run, the kit’s own game, runs above: three minutes, four waves, one kite against a swarm of hundreds. Gather gems, burst when it closes in, and play it in whatever look the page wears: switch the look and the world, the HUD and the menus all change with it.

The parts, and what each does in it

  • Reskin seam for 2D games and visual appsDraws the arena, the swarm, the bolts and every hit in three instanced layers, its colours read from the page’s tokens; Canvas 2D where there is no WebGPU.
  • 2D crowd for action gamesHundreds of darts, needles, rings and hulks, each kind steering its own way, kept apart and clinging round the kite (with spatial-grid-2d’s grid inside).
  • Wave director for action gamesShapes the three minutes: the crowd curve, groups from beyond the view, a surge every half minute, hulks at set times, four named waves.
  • Game feel for 2D: shake, hit-stop and a follow cameraThe follow camera that leans toward the aim, trauma shake on bursts and hulks, and the hit-stop; all calm when Motion is off.
  • Play input for couch and party gamesKeys, a pad or a touch stick on a fixed 60 Hz clock, the burst button only on touch, and the aim channel: mouse, right stick or auto-aim.
  • GPU capability tiersJudges the first frames’ GPU time and steps the swarm’s cap down once on a slower card.
  • Game HUD that lives in the worldSpark and charge ring the kite, the strip keeps wave, score and clock, callouts point at surges and hulks, an edge marker at a hulk off screen.
  • Pause ring and game settingsThe pause ring round the frozen kite, and settings with sound, motion, the tier in words and key rebinding that reaches the input.
  • Run summary: words, route and timelineThe end: words from the run, the route with its pillars, the timeline of the four waves, the best and the deck kept on the device.
  • Accessible dialogs: modal, sheet, confirmHolds the pause ring, the settings sheet and the end screen: focus kept in, Esc, the game inert behind.
  • Effects switchboardThe Sound and Motion switches, kept, following the system’s reduced motion.
  • Synthesised game soundsBolts that crackle, pops that climb a scale with the chain, pickups, the burst, surges and the end.
  • Menus by gamepadA pad round the title, the ring, the settings and the end: the stick points at a spoke, A presses, B goes back, Start pauses.

What a game writes itself

  • The rules (rules.ts): the kite, the stream of bolts and its upgrade ladder, the burst, gems, spark, scoring and what the end screen needs recorded.
  • The skin (skin.ts): what each thing looks like in skin-seam’s pen, colours read from the tokens, ink outlines in thick-lined looks, light and bloom in dark ones.
  • The flow (scene.ts): title over a bot-played run, play, pause, settings, the end and again; counts per tier; events into sound, callouts and shake.
  • The look picker: data-look and data-theme on the scene’s own root, so five looks can be worn without touching the page.

Playbooks it follows

Performance budgets · Scenes that hold up

With an agent

Ask for it by name: get_kit("2d-action") on the store’s MCP server plans a build from these parts, free. See With AI to connect one.