实验说明
Every shape is a real soft body, not a sprite that wobbles. A tetrahedral lattice is solved with XPBD — edge constraints carry the firmness you set, a volume constraint on each tet keeps the gelatin nearly incompressible, so a block squashed from above has to bulge out sideways.
Bodies collide particle-to-particle through a spatial hash, twice per substep, with friction. The lattice sits a fixed distance inside the skin, so a contact resolved at that distance lands the two surfaces exactly on each other — they touch and stop, they do not pass through. Anything that has stopped moving falls asleep and stops being solved, so a full well still runs at frame rate; a hard landing wakes its neighbours again.
The skin is a Surface Nets mesh built from the shape’s signed distance field, with normals read straight off the gradient, then bound to the lattice by trilinear weights. Light is the same two-pass treatment as No. 001: back faces first for normal and depth, front pass subtracts them for thickness, refracts twice, and applies Beer–Lambert absorption over that distance.
A line clears the way it does in Tetris, one row at a time. There is no grid underneath, so before anything is judged full each unit cell of settled jelly is mapped to the single well row it overlaps most — and two layers of one piece can never claim the same row. A row is full when that map covers all ten column centres, and the clear then takes exactly the cells mapped into it. Because the jelly is a real solid, taking them means surgery: the body is split along the row, the layer inside it dissolves, and whatever survives is rebuilt as its own soft body and handed back to gravity. A bar standing through a cleared line comes out one cell shorter and keeps falling; the rest of the shape is never touched.