All examples · Physics · As Markdown, for AIs

Retro physics from a document

What this example shows

The editor's path: a scene written down as a document, with a retro-world-2d on its root and a retro-body-2d on each object, read with parseSceneDoc and built with sceneFromDoc. The engine keeps, reads and writes these with nothing installed; installRetroPhysics2d() is what makes them move.

Every field a body leaves out is filled in when the file is read (bounce 0, drag 0, no speed limit, gravityScale 1, mass 1…), so a document means one thing whoever reads it.

Starting
Starting
—