Let me start by exploring the project structure and understanding the setup, then I'll build a complete parkour game.
Now I'll build the complete parkour game. Let me start with the foundation files.
Now let me write the main App component with the UI overlays:
Now let me write the CSS with all the game styling:
Let me build the project to check for errors:
The build is clean. Let me enhance the game loop to render the background even before the game starts, so the start screen has a nice visual behind it:
Let me add pause handling to the tap handler so tapping the canvas while paused also resumes:
Let me also prevent double-firing from touch + click events on mobile:
Build is clean. Let me do a final review of the complete game to ensure everything is polished:
The game looks complete and well-structured. Let me run a final build to confirm:
The build is clean and successful. Here's a summary of the complete game I've built:
🏃 跑酷游戏 | Neon Parkour
What was built
A complete, polished endless runner / parkour browser game with a cyberpunk neon aesthetic.
Files created/modified
| File | Purpose |
|---|
index.html | Updated title to "跑酷游戏 | Neon Parkour" |
src/game/types.ts | All types, constants, and helper functions |
src/game/engine.ts | Game engine — loop, physics, spawning, collision, particles, rendering |
src/App.tsx | React component with UI overlays (start, HUD, pause, game over) |
src/index.css | Complete styling with animations, responsive design, neon effects |
Game Features
🎮 Core Loop
- Auto-running character with jump (Space/↑/W/Tap) and double jump
- Three obstacle types: walls, double walls, and floating barriers
- Speed gradually increases, reaching up to ~2.5x starting speed
- Score = distance + 10 bonus per obstacle passed
💥 Juicy Feedback
- Screen shake on death (12px intensity, decays exponentially)
- Particle effects on jump (cyan), double jump (magenta burst), landing (gold), death (30-particle explosion), and running trail
- Squash & stretch on jump/land (1.3x stretch → 0.6x squash → smooth recovery)
- Neon glow on all game elements with pulsing animations
- White flash on death (0.15s)
🎨 Visual Theme
- Dark cyberpunk sky with twinkling stars
- Parallax scrolling city skyline with lit windows
- Neon ground with animated grid lines
- Player: sleek geometric figure with glowing visor and animated run cycle
- Obstacles: glowing magenta neon shapes with inner patterns
🕹️ Controls
- Keyboard: Space/↑/W = jump/double jump, ESC/P = pause, Enter/Space = start/restart
- Touch: Tap anywhere = jump, double tap for double jump
- Smart debounce (300ms) to prevent touch + click double-firing
📱 Screens
- Start: Animated title "彩虹跑酷", controls guide, high score display
- HUD: Live score with neon glow, top-right
- Pause: Overlay with current score, resume button
- Game Over: Score with pop-in animation, NEW HIGH SCORE celebration, instant restart
🏆 High Scores
- Persistent via
localStorage under parkour_highscore
- Displayed on start screen and game over screen
⚡ Performance
- Canvas 2D rendering with
requestAnimationFrame
- Delta time capped at 50ms to prevent physics explosions
- Particle cap at 200
- Responsive canvas scaling with aspect ratio preservation
Files built: index.html, src/game/types.ts, src/game/engine.ts, src/App.tsx, src/index.css