diff --git a/CHANGELOG.md b/CHANGELOG.md index 63e31b3..532ecfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -161,6 +161,11 @@ compare links at the bottom are pointed at the `v1.0.0` tag. resolves strictly against the runner's nearest lane, so sliding toward a booster can't accidentally eat the junk in the lane you're leaving — booster gauntlets stay dodgeable as designed. +- **Touch restart hint no longer mentions a missing key:** the solo finish + overlay said "press R to race again" even on mobile, where there's no R key. + It now reads "tap to race again" on touch devices (restart is a screen tap); + desktop keeps the R hint. The how-to-play touch column and `GAME-DESIGN` + document the tap-to-restart gesture. #### Internals diff --git a/components/game/game-canvas.tsx b/components/game/game-canvas.tsx index 15af8e5..d113ad7 100644 --- a/components/game/game-canvas.tsx +++ b/components/game/game-canvas.tsx @@ -71,6 +71,7 @@ export function GameCanvas({ go: tt("go"), finish: tt("finish"), again: tt("again"), + againTouch: tt("againTouch"), practiceNote: practiceRef.current ? tt("practiceNote") : undefined, goodPhrases: tt.raw("goodPhrases") as string[], badPhrases: tt.raw("badPhrases") as string[], diff --git a/components/how-to-play/how-to-play-content.tsx b/components/how-to-play/how-to-play-content.tsx index 40c55d8..b8064a1 100644 --- a/components/how-to-play/how-to-play-content.tsx +++ b/components/how-to-play/how-to-play-content.tsx @@ -121,6 +121,14 @@ function Controls() { {t("controlsTouchSprint")} +
  • + + + 👆 + + + {t("controlsTouchRestart")} +
  • diff --git a/docs/GAME-DESIGN.md b/docs/GAME-DESIGN.md index 58c3a85..a282bbc 100644 --- a/docs/GAME-DESIGN.md +++ b/docs/GAME-DESIGN.md @@ -53,6 +53,7 @@ devices and drawn inside the Phaser canvas so it works identically in every mode | ------------------------------ | -------------------------------- | | ◀ ▶ (bottom-left, left thumb) | Tap to change lane (one per tap) | | ⚡ (bottom-right, right thumb) | Hold to accelerate / sprint | +| Tap anywhere (after finish) | Restart a solo run | Design rules: diff --git a/lib/game/scenes/race-scene.ts b/lib/game/scenes/race-scene.ts index 1277f26..7235ff0 100644 --- a/lib/game/scenes/race-scene.ts +++ b/lib/game/scenes/race-scene.ts @@ -86,6 +86,8 @@ export type GameStrings = { go: string; finish: string; again: string; + /** Touch variant of `again` — restart is a screen tap, not the R key. */ + againTouch: string; /** Shown on the finish overlay of a solo practice run, to make clear it * doesn't persist to the leaderboard. Absent for matches and the demo. */ practiceNote?: string; @@ -100,6 +102,7 @@ const DEFAULT_STRINGS: GameStrings = { go: "GO!", finish: "🏁 FINISH!", again: "press R to race again", + againTouch: "tap to race again", goodPhrases: ["yum! 😋", "pure energy ⚡"], badPhrases: ["ugh, bad idea 🤢"], boostPhrases: ["full speed! 🚀", "turbo on ⚡"], @@ -916,8 +919,11 @@ export class RaceScene extends Phaser.Scene { const note = this.strings.practiceNote ? `\n${this.strings.practiceNote}` : ""; - // In a match, "press R to race again" doesn't apply — the result stands. - const tail = this.net ? "" : `\n${this.strings.again}`; + // In a match, "race again" doesn't apply — the result stands. On touch + // devices restart is a screen tap (onPointerDown), so swap the R hint. + const tail = this.net + ? "" + : `\n${this.touchControls ? this.strings.againTouch : this.strings.again}`; this.showToast( `${this.strings.finish}\n${this.elapsed.toFixed(1)}s ${this.points} pts${note}${tail}`, 9999 diff --git a/messages/en.json b/messages/en.json index f216855..04b3f93 100644 --- a/messages/en.json +++ b/messages/en.json @@ -182,6 +182,7 @@ "go": "GO!", "finish": "🏁 FINISH!", "again": "press R to race again", + "againTouch": "tap to race again", "practiceNote": "Practice run — doesn't count for the ranking", "goodPhrases": [ "yum! 😋", @@ -282,6 +283,7 @@ "controlsTouch": "📱 Touch (mobile)", "controlsTouchLanes": "tap to change lane", "controlsTouchSprint": "hold to accelerate (spends energy)", + "controlsTouchRestart": "tap to restart", "zapTitle": "⚡️ Zap the winner", "zapText": "When the race ends, you can send sat zaps to the winner. Running fast pays out in Bitcoin.", "rankingTitle": "🏆 Ranking", diff --git a/messages/es.json b/messages/es.json index 9f9b639..2a8bccc 100644 --- a/messages/es.json +++ b/messages/es.json @@ -182,6 +182,7 @@ "go": "¡YA!", "finish": "🏁 ¡META!", "again": "apretá R para correr de nuevo", + "againTouch": "tocá para correr de nuevo", "practiceNote": "Carrera de práctica — no cuenta para el ranking", "goodPhrases": [ "¡glup! 😋", @@ -282,6 +283,7 @@ "controlsTouch": "📱 Táctil (móvil)", "controlsTouchLanes": "tocá para cambiar carril", "controlsTouchSprint": "mantené para acelerar (gasta energía)", + "controlsTouchRestart": "tocá para reiniciar", "zapTitle": "⚡️ Zap al ganador", "zapText": "Cuando termina la carrera, podés mandarle zaps de sats al ganador. Correr rápido se paga en Bitcoin.", "rankingTitle": "🏆 Ranking",