All examples · Physics · As Markdown, for AIs

Jelly piggies

What this example shows

useSoftBody2d makes each piggy a soft body in the 2D world: a ring of sixteen corners held to each other, to the area they enclose and to the shape they started as. It falls, squashes when it lands, rolls down the hills of the map and springs back.

Its face is a createPolygon with the same sixteen corners, handed to the body as polygon: every frame the body moves them, and the picture squashes and turns with it.

You never move a piggy: ← → tilt the world, which pushes each one (push) and turns the camera, and Space makes them hop (kick).

Starting
Starting
—