I will check the existing structure of the project to understand the starting setup.
I will check the contents of package.json to see what libraries are available.
I will install three, @types/three, and lucide-react to support 3D rendering and UI icons.
I will check index.html to ensure proper title and canvas container setup.
I will edit index.html to set the title and meta information for Marina Bay GTA game.
I will create src/types/game.ts to define data types for mission state, vehicle parameters, player controls, city components, and audio settings.
I will create src/game/audio/SoundEngine.ts to implement a procedural WebAudio synthesizer for realistic engine RPM, tire drift squeal, metallic collision hits, footsteps, and switchable synthwave radio stations.
I will fix the unused property warning in SoundEngine.ts.
I will create src/game/textures/TextureGenerator.ts to procedurally generate all asphalt road textures, brick walls, glass curtain walls, neon sign textures, and traffic sign SVG textures.
I will create src/game/procedural/SVGGeometryUtils.ts to build standard Lathe and Extrude geometries using SVG 2D profile curves for wheels, streetlights, cones, hydrants, and spoilers.
I will create src/game/procedural/VehicleBuilder.ts which uses declarative JSON component assembly with strict left-right symmetry and grid snapping to build 5 high-detail vehicles.
I will correct the size parameters in VehicleBuilder.ts for the police SUV wheels.
I will create src/game/procedural/CityBuilder.ts to implement procedural city generation for Marina Bay City, including road grids, crosswalks, extruded bevel curbs, bridge guardrails, skyscrapers, harbor dock cranes, and street decorations.
I will create src/game/physics/CharacterPhysics.ts to control third-person pedestrian walking, running, footstep sound triggers, collision checks, and entering/exiting vehicles.
I will create src/game/physics/VehiclePhysics.ts to implement vehicle physics, steering, handbrake drifting, wheel mesh animations, and collision bounce response.
I will create src/game/camera/DynamicCamera.ts to implement smooth camera trailing inertia, orbital freelook, dynamic FOV speed effects, and collision impact screen shake.
I will remove the unused fields in DynamicCamera.ts.
I will create src/game/missions/MissionManager.ts to implement the campaign story progression, timer countdowns, 3D waypoint indicators, and dynamic GPS ribbon line rendering.
I will remove the unused import in MissionManager.ts.
I will create src/game/components/Minimap.tsx to display a real-time rotating 2D minimap with player arrow, city road network, vehicles, and GPS mission route overlay.
I will create src/game/components/Speedometer.tsx to display the driving HUD with digital speed, gear indicator, RPM gauge, and drift status.
I will create src/game/components/MissionHUD.tsx to display active story campaign objectives, countdown timer, and beginner guidance tips.
I will create src/game/components/RadioHUD.tsx to display the switchable synthwave radio station widget in the top-right corner.
I will create src/game/components/HelpModal.tsx to implement the comprehensive 'H' keybindings and gameplay guide modal.
I will remove the unused import in HelpModal.tsx.
I will create src/game/components/TopHeader.tsx for top-left quick controls including time-of-day toggle, car repaint palette, audio mute, and help modal trigger.
I will create src/game/procedural/ParticleSystem.ts to render dynamic crash spark particles and tire drift burning rubber smoke effects.
I will remove the unused field in ParticleSystem.ts.
I will edit ParticleSystem.ts to keep scene as a constructor parameter.
I will read ParticleSystem.ts to inspect the code.
I will remove line 16 from ParticleSystem.ts.
I will create src/App.tsx implementing the full game loop, Three.js rendering scene, physics updates, WebAudio sound synthesis, UI overlays, and story progression.
I will fix the TypeScript state and reference typing in src/App.tsx.
I will read src/App.tsx around the state initializations.
I will read src/App.tsx around lines 430-500.
I will update src/App.tsx to properly type currentMission as MissionStep | null and remove redundant static definitions.
I will read the lines around 435-455 and the bottom of src/App.tsx.
I will read the end of src/App.tsx.
I will update src/App.tsx to properly annotate closestCar and remove STORY_MISSIONS_REF.
I will remove STORY_MISSIONS_REF from the end of src/App.tsx.
I will build the project to verify that there are no compilation or type errors.
我已为您成功做好了这一款致敬 GTA 系列的 3D 网页单机动作驾驶游戏——《滨湾城市 (Marina Bay City)》。
🌟 核心建设与约束实现
1. 3D 建模(核心约束 100% 遵守,最高优先级)
- 禁止手写顶点:全场场景与模型完全基于三种规则生成:
- SVG 剖面 → 车削(Lathe) / 挤出(Extrude):
SVGGeometryUtils 生成轮胎轮毂、沿海路灯杆、交通锥、消防栓、尾翼 Spoiler、路牙(Curb) Bevel 截面及滨湾灯塔塔身。
- 声明式零件 JSON 组合:
VehicleBuilder 通过 JSON 描述汽车零件(尺寸/坐标/旋转/材质),强制 X 轴左右镜像对称 与 固定栅格步长吸附。高精度合成了 4 款特色载具:
- Apex Cyber GT(红蓝极速跑车)
- Thunder V8 Coupe(肌肉轿跑)
- Hyperion SV(超跑旗舰)
- Marina Bay Police Interceptor(警用 SUV 拦截车,含红蓝发光警灯)
- 程序化规则铺设:
CityBuilder 铺设沥青路网、斑马线十字路口、高架跨海大桥、防撞护栏、码头堆栈集装箱、大型龙门吊及市中心玻璃幕墙摩天大楼。
2. 2D 美术与 PBR 材质
- 全流程程序化贴图(
TextureGenerator):
- 沥青路面:带噪点颗粒、双黄线与虚线车道线。
- 斑马线 tile、红砖墙面、高楼玻璃幕墙(随机夜间灯光窗口)。
- 霓虹招牌:动态生成 CYBER CLUB 2077、MARINA PLAZA 等原创 SVG 招牌贴图并带自发光 Glow。
- 原创交通标志:限速 80、急转弯、码头指示牌。
- 画面质感:物理 PBR 材质(车漆清漆 Clearcoat + 玻璃透光与金属度)+ 日夜/黄昏平滑切换 + 指数体积雾 + 实时柔和阴影。
3. 驱动手感与物理反馈
- 无缝模式切换:第三人称步行与车辆驾驶无缝切换(靠近车辆按 E 或 F 上下车)。
- 极佳操控手感:
- 包含油门/刹车/倒车、随车速自动调整的方向盘转向灵敏度。
- 手刹漂移 [Space]:触发侧滑摩擦力衰减,同时生成橡胶烧灼烟雾粒子与轮胎侧滑音效。
- 撞击反馈:碰撞建筑或护栏时,触发镜头震屏(Screen Shake)、火花粒子爆裂以及金属撞击音效。
4. 100% WebAudio 程序化音效
- 动态引擎声:根据油门与齿轮档位平滑调节振荡器频率与低通滤镜。
- 轮胎摩擦声:根据漂移侧滑向量实时触发带 Q 值的带通白噪声。
- 原创车载电台:按 R 切换 3 个合成器电台:
- FM 88.4 BAYSIDE RETRO (Synthwave 80s 节奏)
- FM 96.8 CYBER PULSE (暗黑赛博重低音)
- FM 102.5 COASTAL LOFI (海边 Chill 惬意旋律)
5. 剧情任务与 HUD 导航
- 小地图 + 3D GPS 导航线:左下角旋转小地图指示玩家朝向、车辆与目标点;道路表面绘制 3D 蓝色动态 GPS 导航流光线。
- 新手引导与任务线:
- 任务 1:启动极速之旅(步行上车)
- 任务 2:滨湾港区试驾(跟随 GPS 导航,体验手刹漂移)
- 任务 3:深夜跨海运送(限时 60 秒穿越跨海大桥送达高楼区)
- 任务 4:极速飙车挑战(中央大道突破 120 KM/H)
- 任务 5:登顶滨湾之巅(驶上北方海岸高地灯塔观景台)
- 自由漫游模式:通关后开启自由逛街,支持顶部菜单随时给车辆更换 6 种改装车漆颜色!
- 按键与帮助:随时按 H 打开极尽详尽的按键指南与地图说明弹窗。全局常驻新手快捷提示栏。
Files built: index.html, src/types/game.ts, src/game/audio/SoundEngine.ts, src/game/textures/TextureGenerator.ts, src/game/procedural/SVGGeometryUtils.ts, src/game/procedural/VehicleBuilder.ts, src/game/procedural/CityBuilder.ts, src/game/physics/CharacterPhysics.ts, src/game/physics/VehiclePhysics.ts, src/game/camera/DynamicCamera.ts, src/game/missions/MissionManager.ts, src/game/components/Minimap.tsx, src/game/components/Speedometer.tsx, src/game/components/MissionHUD.tsx, src/game/components/RadioHUD.tsx, src/game/components/HelpModal.tsx, src/game/components/TopHeader.tsx, src/game/procedural/ParticleSystem.ts, src/App.tsx