I'll create a 3D racing game inspired by Need for Speed. Let me first explore the project structure.
I'll build a comprehensive 3D racing game using Three.js. Let me install the dependencies first.
This is a substantial 3D game. Let me build it in well-organized modules. First, the core game engine with Three.js.
Now let me create the vehicle builder module.
Now the main game engine with physics, AI, combat, skills, and effects.
Let me fix the unused field.
Now the main game engine — this is the largest module with physics, AI, police, combat, and skills.
The p variable is unused in resetGrid. Let me remove it.
Now the React UI with the HUD, skill buttons, minimap, and overlays.
Let me create the StartScreen component.
Now the main HUD component with speed, health, skills, minimap, and result overlays.
Now the Minimap component.
Now let me update the page title and build the project.
The build succeeded. I've created a complete 3D racing game inspired by the arcade-pursuit style of Need for Speed. Here's what was built:
🏎️ Nitro Pursuit — 极速追缉
Core racing (Three.js 3D engine)
- A neon night-city circuit built from a Catmull-Rom spline with textured asphalt, glowing guardrails, a checkered finish arch, skyscrapers and starfield.
- Full car physics: acceleration, braking/reverse, speed-scaled steering, off-road grip loss, and a smooth speed-reactive chase camera with FOV kick.
- Complete 3-lap race with live rank calculation among 6 racers, lap counter, and timer.
Opponents & Police
- 5 AI racers that follow the racing line, slow into corners, and jostle for position.
- 3 police cars with flashing red/blue light bars that break from the pack to actively hunt and ram you when you're near — including a "ram boost" police item.
Combat & damage system
- Impact-based damage: the faster aggressor deals more damage; heavy hits spawn sparks/explosions.
- Every vehicle has a health bar. At 0 HP it triggers a destruction animation (explosion particles + spinning/sinking wreck) then respawns after a delay.
- The player has armor + 5 lives — each wrecking costs a life with a "WRECKED" respawn overlay; reaching 0 lives = 竞速失败.
Four tactical skills (keys 1-4 or on-screen buttons with cooldown sweeps):
- 🔥 超级涡轮 — nitro boost (speed + FOV + exhaust flames)
- 🪤 钉刺带 — drops a spike strip that instantly destroys any car that drives over it
- ⚡ EMP攻击 — locks onto the target ahead in a cone over ~1.6s (with a lock-progress ring) then delivers big damage
- 📡 干扰器 — disables police items for its duration
HUD — rank/lap/time panels, glowing SVG minimap tracking all cars, big speedometer, armor bar with life icons, EMP lock reticle, action toasts, animated countdown, and win/lose screens with restart.
Use WASD/arrows to drive and 1-4 for skills. Everything builds cleanly and is ready to play.
Files built: src/game/track.ts, src/game/vehicle.ts, src/game/effects.ts, src/game/Game.ts, src/App.tsx, src/components/StartScreen.tsx, src/components/HUD.tsx, src/components/Minimap.tsx, index.html