Skip to content

Any game (control retrofit)

Mobile-First Touch Controls Retrofit

Tested with Claude · produced Deep Diver

The Prompt

You will retrofit full mobile touch support into an existing HTML5 game. I will paste the current code after these requirements — do not rewrite the game logic unless necessary.

Requirements for the touch layer:
- Use Pointer Events (pointerdown/move/up/cancel) uniformly for touch and mouse; set touch-action: none on the canvas to stop scroll/zoom interference.
- Control scheme: [choose one: "hold left/right halves of the screen to steer", "tap anywhere to jump/act, with swipe up reserved for pause", "drag to move horizontally, following the finger with slight smoothing"].
- Multi-touch safe: track pointer IDs properly; two fingers must not double-fire actions.
- 44px minimum effective touch targets for any on-screen buttons; draw simple canvas buttons for pause/restart if needed.
- No hover-dependent input: everything must work without a cursor.
- Prevent double-tap zoom and pull-to-refresh via meta viewport and CSS overscroll-behavior.
- Keep desktop keyboard controls working; the two input paths must never conflict.
- Handle orientation changes and resize without breaking the letterboxed layout.

Output: the full updated file with the touch layer integrated, then a short checklist of manual tests on a real phone (thumb reach, accidental input, pause reachable).

What This Prompt Produces

The best retrofit prompt we have used: pointing the AI at pointer events and touch-action: none kills 90% of mobile game bugs in one pass. Deep Diver uses this control scheme — re-verified on Claude Opus 5.5 in October 2026.

Modification Tips

  • Paste your full game file after the prompt — context beats summaries.
  • Test on a real phone, not just devtools emulation; thumb ergonomics never show up in a simulator.
  • If accidental pause taps annoy you, follow up with: "Move the pause zone to the top-right corner with a visible icon."
  • Fixed numbers (44px targets, 120ms smoothing) come out exact on Opus 5.5 — never write "reasonably sized" and hope.

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.