Repository navigation
fix(game): show tap-to-restart hint on touch instead of "press R" - #45
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Changes
lib/game/scenes/race-scene.ts—GameStrings+DEFAULT_STRINGSgainagainTouch; finish overlay picks the variant fromtouchControls.components/game/game-canvas.tsx— passagainTouch.messages/{en,es}.json— addgame.againTouchandhowToPlay.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