ai21.net
语言

Build a racing game inspired by Ignition (1997): angled to…

演示视频

Build a racing game inspired by Ignition (1997): angled to… — 1

提示词

Build a racing game inspired by Ignition (1997): angled top-down camera, arcade-leaning
physics, vehicles with very distinct personalities. This must be an original game,
not a copy. Use an original name, an original track, and zero original assets.

## Stack
- Vite + TypeScript (strict), Three.js for rendering, no UI framework
  (HUD in plain DOM/CSS).
- Low-poly graphics generated in code (BoxGeometry, CylinderGeometry, etc.),
  no external models or textures. Solid colors and simple materials.
- Custom simplified 2.5D physics (movement on the XZ plane, height from terrain).
  No physics engine.

## Architecture
- src/game/ (game loop with fixed timestep), src/vehicles/, src/track/, src/ai/,
  src/render/, src/ui/
- Vehicles are data-driven: mass, power, top speed, grip, steering, collision
  resistance, and boost parameters (strength, duration, recharge time).
  One Vehicle class, different configurations.
- Any vehicle can be controlled by either the player or the AI
  (shared control interface: throttle, brake, steer, boost).
- Track as data: centerline spline + width + list of zones
  (ice, shortcut, obstacle). Generate the road mesh and AI waypoints from it.

## Vehicles (original names, no brands)
Four vehicles. The player picks one on the selection screen; the remaining 3
are driven by the AI.
- 90s-style police sedan (black and white, light bar): heavy, stable,
  pushes hard in collisions.
- Muscle car convertible: fastest on straights, oversteers in corners.
- Red monster truck: slow, but ignores bumps and rams everything else.
- Postal delivery van: slow, high center of gravity, sways in corners.
The handling differences must be clearly noticeable. All four must be playable
and competitive. Slower vehicles compensate with e.g. collision resistance,
terrain handling, or a stronger or more frequent boost.

## Boost
- Every vehicle has a boost: a short, pronounced acceleration beyond its
  normal top speed.
- Boost charges automatically from 0 to 100%. It can only be used at 100%.
  After use, the meter drops to 0 and starts charging again.
- Strength, duration and recharge time are unique to each vehicle
  (e.g. muscle car: short and very strong; van: weaker but recharges fast;
  monster truck: long but slow to recharge).
- Visual effect while boosting: exhaust flame or trail, slight camera
  pull-back.
- The AI also uses boost, sensibly: on straights, not before sharp corners
  or on ice.

## Track
A mountain town with a Canadian feel, winter turning into spring thaw:
- closed loop, roughly 60–90 seconds per lap
- a waterfall visible from the track and a wooden bridge over a river
- a railroad crossing with a train passing periodically
  (collision = strong knockback, not game over)
- ice patches with reduced grip
- one shortcut (tight, risky); decorations: spruce trees, wooden houses, snow
- barriers or natural obstacles so vehicles can't get stuck off the track.
  Failsafe: if a vehicle (including bots) is stuck for more than ~4 s,
  automatically return it to the track at the last checkpoint.

## Gameplay
- 3 laps, standing grid start, 3-2-1 countdown
- AI follows waypoints with a driving style that depends on the vehicle,
  light rubber-banding, avoids obstacles, no teleporting (except the
  failsafe track return described above)
- Sliding comes purely from physics (grip, speed, ice), no handbrake
- Camera: top-down at ~50°, follows the player with a slight look-ahead
  in the direction of travel
- Controls: arrows/WASD (throttle, brake/reverse, steering), space = boost
- Screens: start → vehicle selection (model preview + stat bars, including
  boost) → race → results → restart (with option to change vehicle)

## HUD
- Position, lap, lap time, best lap, minimap.
- Boost meter styled as a car battery: rectangular casing with two terminals
  (+/−) on top, fill level rises as it charges. Color shifts from red through
  yellow to green. At 100% the battery clearly signals readiness (pulsing or
  glow, "BOOST" label or lightning bolt icon). While boosting, the meter
  drains quickly.

## Out of scope for v1
Sound, options menu, multiple tracks, multiplayer, save state.

## Workflow
1. First propose a plan and file structure, then implement in stages:
   (a) game loop + one vehicle on a flat plane, including boost,
   (b) track, (c) remaining vehicles and AI, (d) obstacles and train,
   (e) vehicle selection, HUD with battery meter, and screens.
2. After each stage run `npm run build` and fix type errors.
3. Add unit tests (Vitest) for vehicle physics, boost logic (charging,
   lockout below 100%, reset after use), and lap/position logic.
4. Finally: a README describing the controls and how to add a new track
   or vehicle.

## Acceptance criteria
`npm install && npm run dev` launches the game. You can pick any of the 4
vehicles and complete 3 laps against 3 bots. Each vehicle handles differently
and has a noticeably different boost. Boost only works with a full battery,
and bots use it too. The train and ice work. Results show the correct order.
Stable 60 FPS on an average laptop.

中文译文

制作一款受 Ignition(1997)启发的赛车游戏:倾斜的俯视镜头、偏街机手感的物理、个性极其鲜明的车辆。这必须是一款原创游戏,而不是复制品。使用原创名称、原创赛道,以及零原作素材。

## 技术栈
- Vite + TypeScript(严格模式),用 Three.js 渲染,不使用 UI 框架(HUD 用纯 DOM/CSS)。
- 低多边形图形由代码生成(BoxGeometry、CylinderGeometry 等),不使用外部模型或贴图。使用纯色和简单材质。
- 自定义的简化 2.5D 物理(在 XZ 平面上移动,高度取自地形)。不使用物理引擎。

## 架构
- src/game/(固定时间步的游戏循环)、src/vehicles/、src/track/、src/ai/、src/render/、src/ui/
- 车辆是数据驱动的:质量、动力、最高速度、抓地力、转向、抗碰撞能力,以及冲刺参数(强度、持续时间、充能时间)。一个 Vehicle 类,不同的配置。
- 任何车辆都可以由玩家或 AI 控制(共用的控制接口:油门、刹车、转向、冲刺)。
- 赛道即数据:中心线样条 + 宽度 + 区域列表(冰面、捷径、障碍物)。由它生成道路网格和 AI 路径点。

## 车辆(原创名称,无品牌)
四辆车。玩家在选择界面挑一辆;其余 3 辆由 AI 驾驶。
- 90 年代风格的警用轿车(黑白涂装,带警灯条):沉重、稳定,碰撞时推挤力强。
- 肌肉车敞篷版:直道上最快,过弯时转向过度。
- 红色怪物卡车:慢,但无视颠簸,并会冲撞其他所有车辆。
- 邮政送货车:慢,重心高,过弯时摇摆。
操控差异必须清晰可感。四辆都必须可玩且有竞争力。较慢的车辆以抗碰撞能力、地形适应能力,或更强/更频繁的冲刺来弥补。

## 冲刺
- 每辆车都有冲刺:一次短暂而明显的、超出其正常最高速度的加速。
- 冲刺条自动从 0 充能到 100%。只有在 100% 时才能使用。使用后,槽归零并重新开始充能。
- 强度、持续时间和充能时间因车而异(例如肌肉车:短促且极强;送货车:较弱但充能快;怪物卡车:持续长但充能慢)。
- 冲刺时的视觉效果:排气火焰或拖尾,镜头轻微后拉。
- AI 也会使用冲刺,且用得合理:在直道上,不在急弯前或冰面上。

## 赛道
一座带有加拿大感觉的山间小镇,冬天正转入春季融雪:
- 封闭环线,每圈大约 60–90 秒
- 从赛道上可见的瀑布,以及一座跨河的木桥
- 一处铁路道口,有火车周期性地经过(碰撞 = 强烈的击退,而不是游戏结束)
- 抓地力降低的冰面
- 一条捷径(狭窄、有风险);装饰:云杉、木屋、积雪
- 设置护栏或自然障碍物,使车辆不会卡在赛道外。失效保护:如果某辆车(包括机器人)卡住超过约 4 秒,自动将其送回赛道上的最后一个检查点。

## 玩法
- 3 圈,静止发车格起步,3-2-1 倒计时
- AI 沿路径点行驶,驾驶风格取决于车辆,轻微的橡皮筋机制,会避开障碍物,不会瞬移(上述失效保护回赛道除外)
- 滑移完全来自物理(抓地力、速度、冰面),没有手刹
- 镜头:约 50° 的俯视,跟随玩家,并朝行进方向略微前瞻
- 操作:方向键/WASD(油门、刹车/倒车、转向),空格 = 冲刺
- 界面:开始 → 车辆选择(模型预览 + 属性条,包括冲刺)→ 比赛 → 结果 → 重新开始(可选择更换车辆)

## HUD
- 名次、圈数、单圈时间、最佳圈、小地图。
- 冲刺条做成汽车电瓶的样子:矩形外壳,顶部有两个接线柱(+/−),充能时液位上升。颜色从红经黄过渡到绿。到 100% 时,电瓶清楚地表示已就绪(脉动或发光,"BOOST" 字样或闪电图标)。冲刺时,槽会快速下降。

## v1 不包含的内容
声音、选项菜单、多条赛道、多人模式、存档。

## 工作流程
1. 先提出计划和文件结构,然后分阶段实现:(a)游戏循环 + 平坦平面上的一辆车,包含冲刺,(b)赛道,(c)其余车辆和 AI,(d)障碍物和火车,(e)车辆选择、带电量表的 HUD,以及各界面。
2. 每个阶段之后运行 `npm run build` 并修复类型错误。
3. 为车辆物理、冲刺逻辑(充能、低于 100% 时锁定、使用后重置)以及圈数/名次逻辑添加单元测试(Vitest)。
4. 最后:一份 README,说明操作方式以及如何添加新赛道或新车辆。

## 验收标准
`npm install && npm run dev` 能启动游戏。你可以任选 4 辆车中的一辆,与 3 个机器人完成 3 圈比赛。每辆车操控不同,冲刺也有明显差异。冲刺只有在电瓶满时才能生效,机器人也会使用。火车和冰面正常工作。结果显示正确的顺序。在普通笔记本上稳定 60 FPS。

溯源

原作者
_nieGRAMotny_
发布日期
2026-09-24(由推文 ID 反解)
原始出处
查看原帖 ↗
收录来源
yihui-dev/awesome-opus5-5-videos · niegramotny-197521 · MIT