petal

Petal is a programming language for creative coding.

flow_field.ptl
compiling petal…
code → canvas

every demo here is editable.

Hit </> source on any sketch to open its code and change it — the canvas recompiles and re-runs as you type. Click the canvas to fling in more balls.

bouncing_balls.ptl
compiling petal…
edit and it runs liveopen in playground →
live gallery

everything here is actually running.

Generative art, a playable game, a paint tool — each is a single Petal file compiled in your browser. Open the source on any of them.

starfield.ptl
compiling petal…

Starfield

3dgenerative

A 3D star projection with motion trails. Warp speed, ~30 lines.

open starfield
snake.ptl
compiling petal…

Snake

gameinteractive

A complete, playable game in one Petal file. Arrow keys to steer.

open snake
paint.ptl
compiling petal…

Paint

toolinteractive

A little paint program — palette, brush sizes, and a procedurally drawn mandala on first run.

open paint
no install required

open a blank canvas and start typing.