悬浮岛像素风帕德尔网球比赛对比

查看完整提示词 ↓
播放
6,723
点赞
152
评论
31
收藏
75

作者使用 Claude Sonnet 5.5 耗时 27 分钟、基于 Three.js 制作了单文件 HTML5 像素风浮岛笼式网球对战玩具,并与 GPT-6.2 Astra 的生成效果进行了对比。

完整提示词14,914 字符

Build a single-file HTML5 toy, "Pixel Padel": a 2 x 2 padel match on a floating pixel-art island that plays itself forever (autopilot by default, endless matches), where the court surface can be repainted at any moment (blue turf, green turf, clay, hard court, beach sand, grass) and every surface really changes how the ball bounces and how the players move. The human can take over either pair. three.js r128 from cdnjs, everything else procedural and inline, no asset files, no build step for the player.

LOOK
- Render the 3D scene to a low-res target (default 2 px art pixels on wide stages, 1 px on phones; slider 1-6), then a post pass: depth-based outlines, snap every pixel to one fixed 90-colour OKLab palette, ordered Bayer dither. Orthographic camera with smooth azimuth / elevation / zoom, pixel-snapped. Sun shadow map; day / dusk / night lighting with four floodlight poles registered as point lights BEFORE the lights are initialised.
- Island (about 104 x 76 m): the same floating island as the other games of the series: a slab of 1 m voxel columns with a rounded outline, a terraced rim, layered soil and slate strata, hanging roots and floating rocks underneath, bushes and flowers on a lawn rim, drifting birds. A 1024 px ground canvas paints a mown lawn (stripes, tufts, flowers), a paved plaza of two warm greys round the court and the stands, gravel paths to a clubhouse and a shop container, a timber terrace. Static meshes are merged by material after building (before anything dynamic is added; the court floor, the glass and the players live in a group that is never merged).
- Scenery: a clubhouse (white walls, terracotta roof, glazed windows, striped awning, a lit "PADEL CLUB" sign, planters), a shop container with an awning, parasols with chairs, palms, cypress trees, hedges, four flag poles in the team colours, a high umpire chair at the net outside the far wall with an umpire who turns his head to follow the ball and raises a flag after each point, benches, a ball basket, a water cooler, racket bags. Four stands (4, 3, 2, 2 rows) hold an instanced crowd (body, head, hat, waving flags) that jumps harder the better the point was; each stand is a "lift sector" that rises out of the way when it stands between the camera and the court. A big scoreboard sign over the far stand shows both pairs, sets, games and points and is redrawn only when the score changes.

THE COURT
- 20 x 10 m. The floor is a plane with a 1280 x 640 canvas texture (64 px per metre) that is repainted on demand. Lines: the two service lines 6.95 m from the net, the centre service line, a shadow stripe under the net, shade along the walls. Surface painters: blue turf (sanded pile, mown stripes), green turf, clay (blotches, brush strokes, slide marks), hard court (blue centre with a green run-off band, specks, cracks), sand (ripples, footprints, blue ribbon lines), grass (mown stripes, worn bare patches at the baselines and the net).
- Walls: glass 3 m with mesh to 4 m at both back walls and in the four corners (|x| >= 6 m), mesh 3 m along the middle of the side walls, steel posts every 2 m, top and mid rails, a door in each side wall. The glass is a transparent, depth-write-off plane with a canvas texture (a tint, diagonal highlight streaks, panel seams every 2 m); the mesh is an alpha-tested wire texture. The walls whose outward normal faces the camera fade out (opacity lerps by the dot product with the camera direction, mesh depth-write is switched off while faded) so you always see the court through the near wall; the far walls stay solid. A ring flashes on the glass where the ball hits it.
- Net: two posts at the walls, 0.88 m in the middle with a little sag to 0.92 m at the posts, white tape, a centre strap, an alpha-tested mesh that wobbles when hit.

SURFACES (a table; the same numbers drive physics, sound, dust and UI)
- Each has: vertical restitution e, horizontal speed kept at a bounce fx, a random kick, the players' run-speed factor, the players' grip (how fast they can change velocity: low grip = sliding), a dust colour and the line colour. Blue turf e .76 fx .80; green turf .72 / .75; clay .80 / .64, grip .60 (slides, dust); hard .70 / .93, grip 1.15, run 1.05; sand .58 / .62, run .88; grass .62 / .84, kick .10 (a small random deflection), grip .78.
- Changing the surface repaints the court with a wipe: the new texture is revealed from one end over 1.1 s with a bright seam while a little paint-roller machine rides along the court; the old canvas is kept so a second change mid-wipe never shows a mixed court. The director camera cuts to the tactical view for a few seconds. The panel has six swatch buttons, three small bar meters (Bounce, Pace, Grip) and a one-line note per surface; key C cycles surfaces; an option "new surface for every match" (on by default in autopilot) walks through all six.
- Also switchable: wall type glass / mesh (glass restitution .78 with .94 tangential retention, mesh .46 / .80 and a random kick), ball speed (worn / normal / new: flight times x 1.2 / 1 / .84), wind (calm / breeze / gale; an acceleration that wanders slowly), level (easy / normal / pro), format (quick: first to 4 games, tie-break to 5; one set to 6, tie-break to 7; best of 3), deuce (golden point / advantage), speed (1/2x, 1x, 2x).

THE BALL
- Position, velocity, drag exp(-0.15 dt), gravity, wind. One shared step function (used by the live ball and by the predictor) handles: the net plane (tape clip = a net cord that lets the ball dribble over, a body hit drops it dead on the hitter's side), the floor with the surface's restitution / speed loss / kick, the back walls and side walls (glass or mesh, with different heights; above the top it is "out of the court") and reports events {floor, wall, net, over}. A launch solver computes the velocity that lands a ball on a chosen floor spot after a chosen flight time (iterating against drag); the net clearance is checked along the flight and the flight time is lengthened until it clears.
- Predictor: every other frame the live ball is simulated forward 4.5 s at 1/60 with all bounces; each sample records time, position, how many floor bounces have happened so far on each half, and whether a wall was hit. The AI plans over this path.

RULES (a state machine: pre, serve, rally, point, fault, over)
- Serve: the server stands behind the service line on the right or left half (by point parity), drops the ball from the free hand, lets it bounce on his own side and hits it underhand low across the net into the DIAGONAL service box (between the net and the service line, the opposite half). Faults: net body, wall or over-the-top before the bounce, first bounce outside the box or on the wrong half, the ball dropped twice without being hit. A net cord that still lands in the box is a let and is replayed; a second fault is a double fault. The serve must bounce before the receiver may touch it (the AI and the contact test both enforce this).
- Rally: after the opponent's shot the ball may bounce once on your side (volleys before the bounce are fine, except for the serve); after that bounce it may come off the glass and the mesh and you may still play it; a second floor bounce on your side loses the point. A return must cross the net and bounce on the opponent's floor before it touches any wall (a wall or the top first = out); a ball that bounced and then leaves the court over the wall (a "por tres" when it was a smash) is a winner; a net body hit or a ball that bounces on the hitter's own side loses the point. One hit per pair per rally turn, players stay on their own half.
- Scoring: 0 / 15 / 30 / 40 with golden point (the next point at 40-40 wins) or advantage; games; sets (6 games, win by 2, tie-break at 6-6); a tie-break to 7 (5 in quick mode) win by 2 with the server changing after the first point and then every two points; the serving pair changes every game and inside a pair the server alternates; ends are changed after every odd game and every 6 tie-break points. Rolling statistics: aces, winners, smash winners, wall plays (returns played after a wall rebound), errors, double faults, matches won, longest rally. After a match the winners celebrate for 8 s and a new match starts (and, if the option is on, a new surface).

PLAYERS
- Jointed voxel figures (hips, torso, head, shoulders, elbows, wrists, knees) with a padel racket (handle, throat, solid oval face in the team colour with a rim and holes) on a wrist group; two pairs, Azure and Amber, four different looks. Poses with keyframes and ease, every channel critically damped by a spring: ready (knees bent, racket up, free hand at the throat), run cycle, forehand and backhand (low to high variants mixed by the contact height; back swing, contact, follow-through across the body), volley punch (either hand), smash (jump, trophy pose, overhead contact), bandeja (high slice), lob (deep knee bend, low to high), the drop, the underhand serve, celebration, dejection, the umpire's sit and flag.
- Each stroke has a duration, a contact window, a reach (a horizontal radius around a point in front of and beside the hitter on the racket side, and a height range; smash adds the jump height) and a lead time (action start to contact). The ball is only played if it is inside the reach during the window and the rules allow it. Movement: acceleration scaled by the surface grip, speed by the surface run factor; on slippery surfaces sliding feet kick up dust; partners are pushed apart; players are clamped to their own half and to the walls.

AI (both pairs, any level)
- Planning: for each player, walk the predicted path and take the first sample that is on my side of the net, within the walls, before the second bounce, not a volley of the serve, whose height fits a stroke (smash 2.25-3.15 m near the net, bandeja overhead, volley before the bounce inside a volley zone that grows when the surface kills the bounce, forehand / backhand after the bounce) and which the player can reach in time (distance to the stand spot / run speed + the stroke's lead). A first pass skips samples right in front of a wall rebound so players let the ball come off the glass; a second pass accepts anything. The pair member with the best score takes the ball (with hysteresis), the other holds position. The stand spot is chosen from forehand or backhand, whichever is closer.
- Style at the moment of the swing: smash / bandeja from high balls; volleys deep, angled or as drop volleys; lob when both opponents are at the net and the ball is low; drop shot when both are deep and I am near the net; drive otherwise. The target is the best of 12 random floor spots by distance from both opponents (plus depth and wall bonuses, plus noise) inside a range that depends on the style; flight times by style (drive ~17 m/s, smash ~26, lob ~2 s, ...). Errors: a random target error that depends on the level, the incoming ball speed, the player's running speed, how awkward the height is, and a fatigue factor that grows with the rally length (so marathons end); unforced errors (wide, long, into the tape) with a per-style probability.
- Formation per pair: net / mid / back zones; the pair advances after a lob or an overhead, retreats when it reads a lob or a deep fast ball (apex above 4.3 m or a deep first bounce) and holds the net against short balls; the two players stay about 3.2 m apart across the court and follow the ball sideways. Serve positions: the server behind the line, his partner at the net, the receiver in the diagonal box area, his partner at the net.

HUMAN CONTROL
- Modes: Watch (default), play Azure, play Amber, two players on one keyboard (WASD + Space / J / K, and the arrows + Enter / . / /). The controlled player of a pair is the one who can reach the ball first (with a margin so it does not flicker); a yellow arrow floats over him and a ring on the floor shows where the incoming ball will bounce. Space serves (once to drop, again after the bounce; pressing early is queued) and in a rally swings: the stroke (forehand, backhand, volley, bandeja) is chosen from the ball's predicted height, bounce count and side. J smashes, K lobs. The direction held while hitting aims: sideways picks the corner, towards the opponents makes it deep, back makes it a soft drop. Shift sprints. Touch: a virtual stick and three round buttons (Hit, Smash, Lob) under the stage on coarse pointers.

CAMERAS AND UI
- Director camera (re-picks by rally): side TV, behind the server, behind a baseline, tactical high view, ball cam, a close celebration cut, an orbit after a match; fixed cameras Side TV, Baseline, Tactical, Ball cam, Island on keys 1-6. Zoom is given in metres of visible width, corrected for the stage aspect ratio. Drag to turn, wheel / pinch to zoom, Q / E rotate, L light, P pause, N new match, M sound, G glass / mesh, C repaint.
- Masthead with the live score; a framed stage with a score-bug (two rows: kit, name, serving ball, completed sets, games, points; a header line with the format and golden point / advantage / tie-break), a rally shot counter, call-out captions (FAULT, LET, OUT, NET, SMASH, LOB, GOLDEN POINT, CHANGE ENDS, ACE, WALL WINNER ...), chips (live / paused, speed, surface, camera, wind) and the latest log line. Panel (below on phones): the court painter first, then match settings, how to play, view (camera, light, turn / zoom, pixel size, outlines, dither, raw 3D, sound, stands lift), a stats table, the rally log, a "How it's drawn" note with the palette swatches. No horizontal scroll at 390 px. Fonts Alfa Slab One, Oswald, Public Sans; CSS tokens with a dark scheme.
- Sound with the Web Audio API only (off by default): the hollow "pok" of a racket (harder for smashes, softer for lobs), a bounce that sounds different on each surface (hard tick, soft clay thud, sand hiss, grass), glass thump with a ring, mesh rattle, the net, a whistle, crowd cheer, wind and birds.

QUALITY BAR
- Headless checks (step the simulation deterministically; software GL is far too slow for real time; apply the player poses every few steps because the held ball follows the hand): no console errors; soak runs of 900-2400 simulated seconds at every level, format and surface with no NaN, no player outside the court, no state stuck (pre < 3 s, serve < 3 s unless a human is serving, rally < 70 s), average rally 8-13 shots (sand shorter), a healthy mix of winners, errors and net points, some faults and aces; a unit test of the scoring that plays 900 random matches over all formats and both deuce rules and verifies set scores, tie-breaks, the serving order (including the 1-2-2-2 tie-break order) and change-of-ends flags; a scripted human completes serves and rallies; all panel buttons, keys and the touch buttons work; 390 px has no horizontal scroll; the repaint wipe is verified by sampling the canvas; scan the file for personal data before publishing.

出处:作者在原帖下的回复。提示词保留原文语言,未做改写。

作者提到的工具

原帖:https://x.com/vib3coded/status/2124529713125187838

全部作品数据开源在 GitHub · awesome-opus-5.5-video。

模型归属以作者自述为准,本站未独立复现。播放量为 2026-11-24 的快照。作品版权归原作者,修改署名或下架请在 X 私信 @GoSailGlobal。

更多模型对比案例