提示词
提示词:
构建一个名为 "Chalk Square" 的单文件 HTML + three.js (r160) 场景:在浮岛上的后院里,用足球玩四方格游戏。这是一个以清晰像素画渲染的真实 3D 场景。
渲染:使用 orthographic isometric camera(拖动时以 90° 为步长旋转,滚轮或双指捏合缩放)。先渲染到带深度纹理的小尺寸低分辨率目标,再用 texelFetch 放大,使其对齐屏幕上的整数像素。添加基于深度的描边,在 OKLab 中将每个像素量化为固定的约 60 色调色板,可选 Bayer 抖动。提供“像素画 / 原始 3D”切换,以及像素尺寸滑块和调色板 / 抖动 / 描边复选框。
院子:打过补丁、开裂的沥青地面,浮岛边缘有路缘石、草地和泥土。沥青地面周围有:
- 一排独立上锁的车库,刷漆的门上有编号,平屋顶向外伸出形成屋檐;
- 一座带警告标志的砖砌变压器房;
- 一棵白杨树,树下有长椅,椅子上坐着一位老奶奶;
- 单杠、挂着地毯的晾毯架、灌木;
- 灯杆上的灯和车库门上方的灯。
鸽子在地上走动啄食,当球或孩子靠近时,会扑扇翅膀飞上屋顶。车库屋顶上的猫会转动脑袋追踪球。
粉笔:覆盖在沥青上的数据纹理。其中包含一个边长 4.8 m、分成四个区域(King、Queen、Jack、Dunce)的正方形,带字母和皇冠,以及跳房子格子和涂鸦。每个纹素存储它在所属笔画中的顺序,使线条能逐步重画。
游戏(8 个孩子,每人都有技能、力量和风格:强攻 / 技巧 / 稳健 / 挑高球):
- 四个孩子上场,四个排队等候。King 将球放落,待球弹起后踢出发球。
- 球必须在你的区域弹一次,然后由你踢进另一区域。采用两次触球规则时,可以先将球卸力垫起。
- 以下情况出局:球落在界外、落在自己的区域、第二次弹地,或(若已设置)落在中线上。其他情况下,压线球重打。
- 出局的孩子去队尾。排在其后的所有人上升一个区域,下一个排队的孩子进入 Dunce 区。一名孩子捡球后扔给 King。
球与 AI:真实的球体物理(重力、弹跳、滚动、水洼中的较弱弹跳、墙壁碰撞)。每位接球者向前模拟球的运动,选出球处于脚部高度的时刻,跑到球后方站好并踢球。踢法包括劲射、挑高球或刚好越线的轻挑,瞄准远离目标孩子的位置;所有人都针对 King。球速越快、触球时身体伸展越勉强、技能越低,瞄准和力度误差就越大,偶尔也会踢呲。
孩子:使用方块骨骼绑定和双骨 IK。姿势:跑步、屈膝准备、在球所在高度击球的踢球动作、卸力接球、持球、投球、鼓掌、争论判罚,以及蹲着走动绘制粉笔线。
时间与天气:白天 / 黄昏 / 夜晚(灯光照亮球场),干燥 / 下雨。
- 下雨:雨丝、溅水、变暗的沥青、通过镜像渲染通道映出院子的水洼,以及被雨水冲淡的粉笔线。
- 孩子们到车库屋檐下避雨。沥青变干后,其中两人重画方格,游戏继续。
UI(英文,浅色和深色主题,移动端布局):
- 带照明的记分板,显示回合数、时钟 + 状态、King 当前的连任时长,以及最佳连任时长。
- 侧栏包含:时间与天气(带沥青和粉笔状态条);排名阶梯(King / Queen / Jack / Dunce,以及“下一位”);规则(一次/两次触球;压线球:重打/出局);判罚动态,以及“围攻 King”和暂停;视图。
- 点击方格中的一个孩子,所有人就会瞄准他。原创设计,不使用真实品牌。原文提示词(English)
PROMPT:
Build a single-file HTML + three.js (r160) scene called "Chalk Square": four square played with a football in a back yard on a floating island. It is a real 3D scene rendered as crisp pixel art.
Rendering: an orthographic isometric camera (drag to turn in 90° steps, scroll or pinch to zoom). Render into a small low-res target with a depth texture, then upscale with texelFetch to whole screen pixels. Add depth-based outlines and quantize every pixel to a fixed ~60-colour palette in OKLab, with an optional Bayer dither. Toggle "Pixel art / Raw 3D", with a pixel-size slider and Palette / Dither / Outlines checkboxes.
Yard: patched, cracked asphalt with a kerb, grass and dirt around the island edge. Around the asphalt:
- a row of lock-up garages with painted, numbered doors and a flat roof that overhangs them;
- a brick transformer booth with a warning sign;
- a poplar with a bench and a grandmother on it;
- a chin-up bar, a carpet rack with a rug, bushes;
- a lamp on a pole and a lamp over a garage door.
Pigeons walk and peck, and flap up onto the roofs when the ball or a kid comes near. A cat on the garage roof follows the ball with its head.
Chalk: a data texture over the asphalt. It holds the 4.8 m square split into four zones (King, Queen, Jack, Dunce) with letters and a crown, plus hopscotch and doodles. Each texel stores its order along its stroke, so the lines can be redrawn progressively.
Game (8 kids, each with a skill, power and style: power / trick / safe / lob):
- Four kids play, four wait in a queue. The King serves by dropping the ball and kicking it after the bounce.
- The ball must bounce once in your zone, then you kick it into another zone. With the two-touch rule you may first cushion it up.
- You are out for: a ball that lands out, lands in your own zone, bounces a second time, or (if set) lands on a middle line. Otherwise a ball on the line is replayed.
- The kid who is out goes to the back of the queue. Everyone below moves up a zone, and the next kid in line enters at Dunce. A kid fetches the ball and throws it to the King.
Ball and AI: real ball physics (gravity, bounces, rolling, softer bounces in puddles, the walls). Each receiver simulates the ball forward, picks the moment it is at foot height, runs to stand behind it and kicks. Shots are a drive, a lob, or a dink just over the line, aimed away from the target kid; everyone picks on the King. Aim and power errors grow with a fast ball, a stretched contact and lower skill, and occasionally a kick is shanked.
Kids: box-rigged with two-bone IK. Poses: run, ready crouch, a kick that strikes at the ball's height, cushion, hold, throw, clap, argue a call, and a crouched walk while drawing chalk.
Time and weather: Day / Dusk / Night (the lamps light the court), Dry / Rain.
- Rain: streaks, splashes, darker asphalt, puddles that mirror the yard via a mirrored render pass, and the chalk washing out.
- The kids shelter under the garage roof. When the asphalt dries, two of them redraw the square and play resumes.
UI (English, light and dark themes, mobile layout):
- A lit scoreboard with rallies, clock + status, the King's current reign, and the best reign.
- A side rail with: Time & weather (with asphalt and chalk bars); the ladder (King / Queen / Jack / Dunce plus "Next up"); Rules (One/Two touches; Liners: Replay/Out); a feed of calls with "Gang up on the King" and Pause; View.
- Click a kid in the square and everyone aims at them. Original design, no real brands.