Skip to content

Gesture combat / defense

Draw-to-Cast Combat With Gesture Spells

Tested with Claude · produced Ink Warden

The Prompt

Build a browser defense game where the only input is drawing. ONE self-contained HTML file (inline CSS/JS, no libraries, no external assets, no start screen). Use Canvas or WebGL for the ink layer and keep all art procedural.

Core input contract:
- The player draws anywhere on the canvas with mouse, finger or pen. Every completed stroke is a blade that damages enemies along its exact path; a quick tap under 120ms fires a small dart instead.
- Sample pointer input at 120Hz, simplify with Ramer–Douglas–Peucker at a 2px epsilon, then resample the stroke to 64 evenly spaced points before recognition. Never recognise from raw event points.
- Expand the stroke into a collision band by interpolating between consecutive points and testing a radius against enemy hitboxes. Thin strokes must still hit fast enemies at 60fps.
Gesture spells:
- Recognise exactly four shapes: closed circle, zigzag (at least four direction reversals), wave (at least two complete sinusoid cycles) and spiral (monotonically increasing radius across at least 540 degrees).
- Score each recognition on confidence 0-1 and grade the calligraphy on smoothness (low curvature variance), speed consistency and closure. Spell power scales linearly with grade; show the grade as a brush seal that stamps on release.
- Reject ambiguous strokes gracefully: if the best confidence is below 0.55, the stroke stays a plain blade and no spell is cast.
- Add a debug overlay that draws the resampled points, the fitted shape and the confidence, toggled with D.
Economy and progression:
- An ink pool that drains per stroke by length and per spell by type, and regenerates from ink drops left by kills. When ink is empty, strokes are thin and weak; the player should feel the cost before they read a number.
- Boss every 5 waves. After each boss, offer three copybook upgrades (for example thicker strokes, cheaper spells, larger inkstone) chosen from a seeded pool.
- Runs last 1-5 minutes; track wave, best grade and total demons cut on the end screen.
Presentation and platform:
- Ink-wash handscroll background composed procedurally: paper grain, bleeding edges, dry-brush gaps, one vermilion accent. Scroll the camera rather than the world.
- Synthesize every sound in WebAudio (brush swish, paper cut, spell hit). No audio files.
- Mobile-first: full-viewport canvas, no scrolling, safe-area padding, touch-action none, and a pause button that works when the tab is backgrounded.
- Respect prefers-reduced-motion by removing camera drift and screen shake.
Deliver in stages: drawing and cutting first, then one recognised gesture, then all four, then ink economy, then bosses and upgrades. Print the recognition thresholds and a table of every spell’s ink cost and damage at the end.

What This Prompt Produces

Ink Warden is the reference build: no start screen, four recognised gestures, calligraphy grading and an ink economy, made with Claude Fable 5. Resampling before recognition is the difference between a spell that fires when you mean it and one that fires when you draw too fast.

Modification Tips

  • Resample to a fixed point count before matching shapes. Raw pointer paths are noisy enough to break every recogniser you write.
  • Make the stroke itself damage enemies. If drawing only triggers spells, the game is a menu with extra steps.
  • Grade the handwriting and scale the spell. It turns a novelty control into a skill you can practice.
  • Keep a plain-blade fallback for low-confidence strokes so beginners are never punished for sloppy drawing.

The Game This Prompt Produced

Want to try it? Open Claude, paste the prompt, and you'll have a playable game in minutes. When you're happy with the result, submit it to Daily AI Games.