Skip to content

fix(game): show tap-to-restart hint on touch instead of "press R" - #45

Merged
analiaacostaok merged 1 commit into
mainfrom
fix/touch-restart-hint
Jun 24, 2026
Merged

analiaacostaok merged 1 commit into
mainfrom
fix/touch-restart-hint

Conversation

@analiaacostaok

Copy link
Copy Markdown
Member

Problem

In practice mode (and any solo run) on mobile, the finish overlay showed "apretá R para correr de nuevo" / "press R to race again" — but touch devices have no R key. There, restart is a screen tap (onPointerDown → resetRace), so the hint was misleading.

Fix

The scene already distinguishes the device via this.touchControls = this.isCoarsePointer() (the same flag that draws the on-screen gamepad). We reuse it to pick the right hint:

  • Touch: "tocá para correr de nuevo" / "tap to race again"
  • Desktop: unchanged — "apretá R para correr de nuevo" / "press R to race again"

Changes

  • lib/game/scenes/race-scene.ts — GameStrings + DEFAULT_STRINGS gain againTouch; finish overlay picks the variant from touchControls.
  • components/game/game-canvas.tsx — pass againTouch.
  • messages/{en,es}.json — add game.againTouch and howToPlay.controlsTouchRestart.
  • components/how-to-play/how-to-play-content.tsx — add a tap-to-restart item to the touch column (which previously omitted restart entirely).
  • docs/GAME-DESIGN.md — document the tap-to-restart gesture in the touch controls table.
  • CHANGELOG.md — Unreleased → Fixed entry.

Verification

  • npx tsc --noEmit ✅
  • npm run lint ✅
  • npm test ✅ (185 passed, 7 skipped)

🤖 Generated with Claude Code

The solo finish overlay always appended "press R to race again", but
touch devices have no R key — there restart is a screen tap. Pick the
hint from the existing touchControls flag, and document the tap-to-restart
gesture in how-to-play and GAME-DESIGN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bitbybit-run Ready Ready Preview, Comment Jun 24, 2026 10:34pm

@analiaacostaok
analiaacostaok merged commit 0a740e0 into main Jun 24, 2026
5 checks passed
@analiaacostaok
analiaacostaok deleted the fix/touch-restart-hint branch June 24, 2026 22:36

This branch was successfully deployed

1 active deployment
Preview — d9933564 Deployed Jun 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant