Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions components/game/game-canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[],
Expand Down
8 changes: 8 additions & 0 deletions components/how-to-play/how-to-play-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ function Controls() {
</span>
{t("controlsTouchSprint")}
</li>
<li>
<span className={styles.touchKeys}>
<span className={styles.touchKey} aria-hidden>
👆
</span>
</span>
{t("controlsTouchRestart")}
</li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions docs/GAME-DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
10 changes: 8 additions & 2 deletions lib/game/scenes/race-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ⚡"],
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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! 😋",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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! 😋",
Expand Down Expand Up @@ -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",
Expand Down
Loading