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