Claude Opus 5.5
山城低多邊形汽車和冬季賽道的互動式 3D 賽車遊戲
提示詞
提示詞: 建立一款受 Ignition (1997) 啟發的競速遊戲:斜角俯視鏡頭、偏街機風格的物理效果,以及個性截然不同的車輛。這必須是一款原創遊戲, 而不是複製品。使用原創名稱、原創賽道,且完全不使用原作素材。 ## 技術堆疊 - Vite + TypeScript (strict),使用 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% 才能使用。 使用後計量條降至 0,並重新開始充能。 - 每輛車的強度、持續時間與充能時間各不相同 (例如:肌肉車敞篷車:時間短但非常強;廂型車:較弱但充能快速; 怪獸卡車:持續時間長但充能緩慢)。 - 加速時的視覺效果:排氣火焰或尾流,以及鏡頭輕微向後拉遠。 - 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. 使用 Vitest 新增單元測試,測試車輛物理、加速邏輯(充能、 低於 100% 時鎖定、使用後重設),以及圈數/名次邏輯。 4. 最後:建立 README,說明操控方式,以及如何新增賽道 或車輛。 ## 驗收標準 執行 `npm install && npm run dev` 後即可啟動遊戲。你可以選擇 4 輛車中的任意一輛, 與 3 個機器人對手完成 3 圈。每輛車的操控方式不同,且加速效果有明顯差異。 只有電池充滿時才能使用加速,機器人也會使用加速。火車與冰面功能正常。 結果畫面顯示正確名次。一般筆記型電腦上可穩定維持 60 FPS。
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.
此提示詞的權利屬於作者 @_nieGRAMotny_。任何商業使用(推廣 AI 工具、聚合平台、Telegram 機器人)由你自行負責,mozgi.io 不承擔任何責任。 詳情 →











