I'll build a polished typing racer with a synthwave neon aesthetic. Let me start by exploring the project structure.
Now I have a clear picture. Let me build this. I'll create:
- A word list + Web Audio synth for juicy feedback
- A game engine hook handling state (start/playing/paused/gameover), input, scoring, race logic
- A single Canvas rendering the neon road, cars, and particles at 60fps
- HUD, word display, virtual keyboard for touch, and overlay screens
- App orchestrator and cohesive synthwave CSS
Let me start building. First, the word list and audio synth:
Now the audio synth — using Web Audio API for juicy SFX with no assets needed:
Now the core game engine hook:
TypeScript narrowed s.phase to "playing" in the outer scope and the inner updater inherits that. Let me fix by removing the redundant inner check (we already early-returned otherwise):
The error is still on line 172, so it must be a different comparison. Let me find it:
The narrowing issue is on the s.phase check inside the game loop. Let me fix by reading a fresh non-narrowed reference:
Now let me build the visual components. I'll create the canvas-based race track with particles, plus the UI components:
Now the word display, keyboard, overlays, and HUD:
Now the main App component that ties everything together:
Now let me build to check for errors:
The build succeeded. Here's a summary of what I built:
KEY RACER — a synthwave typing racer
Core loop (hooks you in 10 seconds): Type words to race your CPU opponent across a neon track. Each correct keystroke plays a pitch-rising blip and advances your car. Complete a word → satisfying arpeggio + particle burst + progress chunk. Wrong key → screen shake + miss particles + combo reset.
Juice & feedback:
- Single
<canvas> rendering at 60fps with RAF loop: synthwave perspective grid floor, retro sun with horizontal slices, animated starfield, two glowing cars with exhaust particles
- Web Audio synth SFX (no asset files): type blip, miss buzz, word-complete arpeggio, combo-milestone chord, win/lose fanfare
- Screen shake on miss via CSS transform, cyan/red overlay flashes
- Particle bursts on every correct word (color count scales with combo) and red sparks on miss
- Haptic vibrate on miss (mobile)
- Combo counter with pop animation, multiplier grows every 5 combo
Controls:
- Desktop: physical keyboard, ESC to pause, SPACE/R to restart
- Mobile: virtual QWERTY keyboard (detected via
pointer: coarse), expected key highlighted in fuchsia, tap anywhere on start screen to begin
- Sound toggle button top-right
States: Start (with high-score table) → Playing → Pause overlay → Game Over (win/loss fanfare, stats, "NEW HIGH SCORE" celebration if applicable, instant restart).
Scoring & high scores:
- Points per word = length × 10 × combo multiplier
- Time bonus for winning, best-combo bonus
- Top-5 high scores persisted in localStorage with score, WPM, and win indicator
- WPM computed from elapsed playtime
Polish details:
- Words tiered by score (3 → 4 → 5 letters) for natural difficulty ramp
- AI accelerates over the race to build tension
- Scanline overlay, neon glowing borders, gradient title text
- DPR capped at 2 for mobile performance
- No scroll bounce, no text selection, dark color-scheme
Build output: dist/index.html 253 kB (78 kB gzipped), single-file bundle.
Files built: src/game/words.ts, src/game/audio.ts, src/game/useGame.ts, src/components/RaceTrack.tsx, src/components/WordDisplay.tsx, src/components/VirtualKeyboard.tsx, src/components/HUD.tsx, src/components/Overlays.tsx, src/App.tsx, src/index.css, index.html