# Claude Opus 5 单次生成完整滑雪游戏

- 来源：jason (@jxnlco)
- 发布时间：2026-07-29 05:49
- AIHOT 分数：73
- AIHOT 链接：https://aihot.virxact.com/items/cms575sj501erroehjaangfdb
- 原文链接：https://x.com/jxnlco/status/2082222045677707480

## AI 摘要

Jason Liu 用一条提示词在 Claude Opus 5 上一次性生成了完整浏览器滑雪游戏“ALPINE RUSH”。游戏基于 three.js 0.160.1，包含无限赛道样条、纯解析地形（无物理引擎）、分块流式加载和程序化音频，目标 60fps，使用固定种子 1337 确保地形确定性。

## 正文

SKI GAME PROMPT

Build me a complete， polished browser game called ALPINE RUSH in ONE single index.html file. It is an endless downhill snowboarding runner with stylized low-poly alpine visuals， AAA-feel post-processing， and fully procedural audio. No build step， no frameworks， no asset files. Use three.js 0.160.1 loaded from the jsdelivr CDN via an import map， including EffectComposer， RenderPass， ShaderPass， UnrealBloomPass， OutputPass， SMAAPass， FullScreenQuad， and BufferGeometryUtils mergeGeometries. Everything else is hand-written. Target 60fps. Put every tuning constant in one CONFIG object at the top， grouped by system， with a fixed seed （1337） so the mountain is deterministic.

VISUAL IDENTITY： Bright bluebird alpine morning. Sky gradient from deep blue 0x2E6FD1 at the top to pale 0xBFDBF7 at the horizon， rendered as a back-side sphere with a custom gradient shader plus a warm sun halo glow baked into the shader. Snow is near-white 0xF2F6FF with cool blue shadows. The rider wears a bold orange jacket 0xE8552D with a yellow helmet 0xF4B93D and blue goggles. Pines are dark green with snow-frosted tiers. Exponential fog 0xC9DDF2 density 0.0025. ACES filmic tonemapping， exposure 1.05， pixel ratio capped at 1.5.

INFINITE TRACK SPLINE： The course centerline is a Catmull-Rom spline generated lazily ahead of the player， control points every 30 meters. Lateral position follows sine S-curves whose wavelength drifts between 150 and 220 m and amplitude between 25 and 40 m （targets re-rolled with 10 percent chance per point， smoothed toward targets）. Vertical drop follows a grade rhythm： mostly 12 to 18 degrees， occasionally 7.5 degree flat runouts or 23 degree steep pitches， held for 5 to 14 control points then re-rolled， smoothed. Expose xAt（z）， yAt（z）， curvature via central difference， and direction dirAt（z）. Use a tiny seeded PRNG （mulberry32） plus a 2D integer hash and 3-octave value noise fbm helper. All randomness in the game must come from these seeded helpers so the world is identical every run.

ANALYTIC TERRAIN， NO PHYSICS ENGINE： Terrain height is a pure function heightAt（x， z）： start from the spline center height， add soft parabolic valley walls beyond 24 m from the centerline （capped so distant forest sits on a slope）， add banking on turn radii proportional to curvature， add two roller layers （a short-rhythm sine modulated by noise plus a long swell sine）， add micro-moguls from 3-octave noise that are groomed nearly flat inside the 16 m half-width piste band （smoothstep mask）， and add jump kickers： asymmetric 2D gaussians with a long gradual up-ramp （sigma about 8.5 to 11.5 m） and a sharp drop after the crest （sigma about 2.7 to 3.6 m） so they launch you. Kickers spawn 0 to 2 per 100 m chunk from the chunk seed， offset up to 9 m laterally， amplitude 1.15 to 2.3 m， and are skipped on tight curve apexes. getHeightAndNormal computes the normal by finite differences. The rider， camera， decor placement， and landing logic ALL sample this one function. No raycasts anywhere.

CHUNK STREAMING： The mountain streams in 100 m chunks， 8 ahead and 2 behind， from a fixed pool of pooled meshes （never allocate during play， build at most one chunk per frame except the initial immediate fill）. Each chunk terrain mesh is a 64-row grid whose columns are dense （1.65 m spacing） inside the 33 m corridor and sparse （6.5 m） outside to 70 m. Rows follow the spline laterally. Compute smooth normals using one extra row beyond each edge so chunk seams are invisible. Store a per-vertex attribute holding the signed lateral distance from the centerline for the snow shader. Bake ambient occlusion into vertex colors： darken verts near every tree and rock with a gaussian falloff， slightly tinted toward blue.

Per-chunk decor from the chunk's seeded RNG： instanced pine forest flanking the corridor （sparse 30 percent density near the piste， 80 percent dense farther out， 3 tree variants， random scale 0.95 to 1.8， slight tilt）， occasional hero tree just inside the piste edge， rock outcrops， rare fallen logs lying across part of the piste， and snow lump bushes dressing the edges. Starting a few chunks in， spawn obstacle trees ON the piste， count ramping with distance up to 4 per chunk， plus occasional on-piste rocks. Three LOD tiers per chunk chosen by camera distance （under 190 m full detail with cast shadows， under 430 m medium， beyond that low poly and hide bushes）. Procedural placeholder models： pines are stacked cones with snow-cap cones per tier on a trunk cylinder， rocks are icosahedrons with per-vertex radial displacement and snowy top faces chosen by face normal， logs are horizontal cylinders with a snow strip on top. Vertex-color everything， flat shading， one shared material.

PICKUPS AND GATES， DELIBERATE PATTERNS ONLY： Never scatter pickups randomly. Per chunk choose a path that traces the flight path over that chunk's kicker， a line of 8 orbs weaving along the spline， a 9-orb arc sweeping across a turn， or a 10-orb zigzag alternating 9 m left and right that forces carve rhythm. Orbs are glowing cyan 0x4FD8FF emissive icosahedrons rendered as ONE InstancedMesh， bobbing and spinning， 50 points each. 30 percent of chunks add a golden boost octahedron （3 seconds of forward acceleration， FOV kick， warm screen tint， radial HUD ring timer）. 10 percent add a white shield star （absorbs one wipeout， badge on HUD）. All pickups magnet toward the rider inside 3 m， collect inside 1.3 m， shrink-pop on collect with a spray burst and an expanding ring shockwave.

Slalom gate trains： on kicker-free chunks， 45 percent chance of 3 gates 32 m apart， alternating 6 m left and right； a red and a blue flag pole pair 7 m apart， oriented to the track direction. Passing within 3.5 m of a gate center scores 250 and bumps combo with a GATE popup； passing within 16 m but missing resets the combo with a GATE MISSED popup. Clear obstacles away from gate lanes.

CARVE PHYSICS， CUSTOM INTEGRATOR： Simulate the rider as a point with velocity on the height field. Gravity 9.81 projected down the local slope gradient. Decompose velocity into the board frame （forward along yaw， lateral）. Holding A/D or arrows leans the board toward a max edge angle of 45 degrees （ease 4.2）. Grip kills lateral slip velocity exponentially， interpolating from 1.8 （flatboard， drifty） to 9.5 （full edge， rails a clean arc）. Yaw rate comes from sin（edge） times 2.35， scaled up to full authority by 7 m/s of speed， and capped by a lateral-acceleration limit of 44 over speed so high speed widens your arcs.

Add a gentle corridor assist that steers toward the track direction within 12 to 24 m of the walls. Friction 0.34 plus quadratic drag 0.0034； holding W or Shift tucks， cutting drag to 65 percent and crouching the character. Carving scrubs a little forward speed proportional to edge. Cap speed at 42 m/s， with the cap and drag improving 35 percent over the first 4000 m， and enforce an endless-runner speed FLOOR that ratchets from 13 up to 33 m/s over 3500 m. At 21 m from the centerline apply a soft quadratic push back plus a red vignette warning， no hard walls. If grounded speed stays under 3.5 m/s for 2.2 s， auto-respawn on the line （R also respawns， with a 1.2 s collision grace）.

AIR， TRICKS， LANDINGS： Takeoff happens when the ground falls away faster than gravity would carry you （compare the surface-following vertical velocity against ballistic； when it drops more than 2.6 m/s below， blend into flight， keeping a fraction of the drop）. Space pops 4.9 m/s off the ground. In the air， A/D banks the board and REDIRECTS the velocity vector like a banked turn at 1.15 rad/s （no flips）， Q/E spin at 720 deg/s with authority ramping in over the first quarter second， S grabs （pitch pose plus a grab timer）， and with no spin input the board auto-tracks toward the flight heading， snapping to the nearest clean 180 so switch landings are possible.

On touchdown compare board yaw to travel； a clean alignment is a clean landing （treat over 130 as switch， measured from 180）， otherwise WIPEOUT. Clean hard landings compress the character， shake the camera， burst snow， ring shockwave， thump sound. Score tricks on landing： 150 per 180 of accumulated spin labeled FS or BS by direction， GRAB adds 120， airtime over 1.15 s with no spin is BIG AIR 100， switch landing adds 80 with SWITCH prefix； multiply by combo and show the trick name center-screen with rising fade animation.

Wipeout： if shielded， consume the shield with a SHIELD SAVED YOU popup and chromatic aberration pulse； otherwise tumble for 1.5 s around a random axis at 40 percent speed with heavy spray， big shake， WIPEOUT popup in red， then the run ENDS. Also wipe out on contact with obstacle trees， rocks， or logs （simple 2D circle and box checks）.

SCORING AND COMBO： Score top right， combo below it as X N COMBO that appears while chaining. Each pickup， gate， or trick bumps the chain and refreshes a 6 s window； the multiplier is 1 plus chain divided by 4， capped at x8， with a scale-pulse animation and a color that heats from white toward orange as it grows. Wipeouts and missed gates reset it. Persist best score in localStorage and show SCORE， BEST， and distance on the end screen.

CHASE CAMERA： Spring-damper follow （stiffness 6， damping 0.85） seated 3.9 up and 9.2 behind heading， with a hard 5 m leash clamp， never allowed below terrain plus 1.35. Look at the rider nudged 6.5 m along the heading， blended slightly toward the spline 12 m ahead. Camera rolls up to 5.2 degrees into carves. FOV eases from 70 to 88 with speed and boost. Perlin-style camera shake decays after impacts. Before the run starts， orbit the rider slowly as a menu camera.

SNOW SHADER： Extend MeshStandardMaterial via onBeforeCompile using the lateral-distance vertex attribute. Add grooming grooves （sin of lateral distance times 17） only inside the groomed band， faded by fwidth so they vanish at distance， a subtle darker band at the piste edge， slight blue tint off-piste， micro normal perturbation from hash noise off-piste and corduroy normal ripple on-piste， sparse view-dependent glitter sparkles （hashed cells， tight specular power 110， additive 3.5x）， and a half-Lambert wrap fill adding cool blue bounce light in shadowed snow. Roughness 0.94.

EFFECTS： Carve trail： a 320-segment ring-buffer ribbon mesh written behind the board whenever grounded above 5 m/s， width growing with edge angle， conforming to the terrain height， fading out over 6 s in a custom shader （store birth time per vertex）. Edge spray： additive point-sprite particle system with a soft radial-gradient canvas texture emitted from the engaged edge， rate scaling with slip and speed； plus a softer normal-blend powder plume （280 pool， larger sprites） behind the board at speed； big radial bursts on landings and wipeouts.

Ten pooled expanding ring shockwave meshes for landings and pickups. Ambient snowfall： 2000 point flakes wrapped around the camera inside an 80x40x100 box， 3 parallax depth layers with different fall speeds， sizes， and opacities， fading at distance and very close range. Distant scenery： two faceted mountain ridge layers plus a dark forest band， built as flat triangle strips with triangular peak silhouettes from noise， vertex-colored rock and snow above a snow line with per-face brightness jitter and haze mix， following the camera so they read as kilometers away. Four huge cirrus cloud planes with canvas-generated soft ellipse noise drifting slowly. Sun： warm directional light （elevation 18 degrees， intensity 3.2） with a 4096 shadow map in a tight 62 m ortho box that follows the rider （2048 on mobile）， hemisphere fill light， plus a visible sun disc and additive halo billboard.

POST-PROCESSING （this is what sells it）： EffectComposer chain： RenderPass， UnrealBloomPass （threshold 0.82）， custom uberA ShaderPass， OutputPass for ACES， custom uberB ShaderPass， SMAAPass. Prepasses each frame： a half-res depth target （RGBA-packed MeshDepthMaterial override） and quarter-res god-ray targets： render only the sun disc on its own layer， then the world with a black override material as occluders， then a 64-tap radial blur from the sun's screen position.

Add depth of field （blur ramps in past 45 m over 130 m， 7-tap poisson， foreground always sharp）， radial motion blur that is zero at screen center and ramps toward the edges with speed， additive god rays tinted warm （intensity faded near screen edges and dimmed when the sun sits dead center）， and faint rotating radial speed streaks past 32 m/s or while boosting.

uberB does： radial chromatic aberration （stronger on impacts）， a filmic grade （blue lift in shadows， warm gold gain in highlights， contrast 1.12， saturation 1.08）， a warm tint while boosting， a red edge tint when grinding the corridor boundary， vignette， and animated film grain 0.03. Track the sun position in screen space each frame and zero the rays when it leaves frame or the camera faces away.

PROCEDURAL AUDIO， NO FILES： One WebAudio context created on first gesture， master gain into output. A noise buffer feeds a bandpass-plus-lowpass board scrape whose gain and cutoff ride speed AND lateral slip （quiet hiss carving， loud roar drifting）， a wind layer whose gain scales with speed squared， and a low ambient mountain-wind bed with a slow LFO. One-shots built from oscillator blips with exponential envelopes： pickup chimes that climb a pentatonic scale with the combo chain， landing thump 120 to 44 Hz plus filtered noise， takeoff and jump whooshes （bandpass sweep up）， a rising sawtooth boost sweep， a three-note shield jingle， a falling shield-break.

HUD AND SHELL： Minimal white HUD with soft shadows， SF-style system font. Top left： big speed in KM/H. Top right： score and the combo readout. Bottom left： distance in m switching to km. Bottom right： circular SVG boost timer arc. Shield badge icon above it. Trick popups rise and fade at bottom center. Start overlay： full-screen sky gradient， huge italic 900-weight title ALPINE RUSH with RUSH in orange， subtitle， a row of frosted-glass key hint chips， and a pulsing CLICK TO RIDE. Click or Space starts； after a wipeout the overlay returns showing SCORE， BEST， and distance with CLICK TO RIDE AGAIN. F toggles an fps readout， an on-page error box catches exceptions， ？autostart skips the menu.

RIDER MODEL： Build a procedural low-poly snowboarder： orange board with rounded nose and tail， bent legs， orange sphere-ish torso， capsule arms， yellow helmet with blue goggle band， in a proper side stance with the chest angled downhill. Rig it as nested groups： a root that follows terrain surface tilt （slerped to the surface normal， easing upright in air） plus travel yaw， a board-tilt group that rolls into the edge angle， and the character that crouches when tucking and carving. Counter-rotate it against the edge， flail the arms in the air， pitch forward when tucking. Cast shadows.

MOBILE： Detect touch. Hold the left or right 40 percent of the screen to carve （also steers in the air）， tap the middle to jump， plus round frosted JUMP and SPIN buttons bottom left and right （SPIN spins toward your held steer side）. Show a rotate-your-phone hint in portrait. Lower pixel ratio to 1.25， reduce flakes， no depth of field.

ADAPTIVE QUALITY： Track a frame-time EMA； when it stays above 19.5 ms， step down a quality ladder： drop pixel ratio to 1.12， then disable depth of field， then disable god rays. Never allocate per frame in hot paths： reuse scratch vectors， matrices， quaternions， compact particle pools in place， and pool every mesh.

Make it feel incredible before anything else： heavy carve grip you can lean on， snow spray pouring off the edge， a camera that surges with speed， crunchy landings， and a combo chime ladder that makes you chase one more gate.

One note： your live version rides the Wednesday voxel character and the voxel nature pack. Since your audience won't have those 66MB of assets， the prompt specs the procedural rider and trees the game itself falls back to when the files are missing， so their result matches yours in every mechanic and everything except that character skin.

### 引用推文

> Ernesto Lopez：This is the prompt I used to 1 shot the Ski game with Claude Opus 5:
