Skip to content

Examples

Complete, runnable programs from examples/. Use them as-is, or follow along with the Tutorials for a step-by-step explanation of the same ideas.

Each example is a single file you can run with:

uv run python examples/<name>.py
Demo File What it shows
Falling box examples/falling_box_demo.py World/body/step API end-to-end
Pendulum joint examples/pendulum_joint_demo.py A DistanceJoint anchor+bob pendulum
Joint chain examples/joint_chain_demo.py Multiple joints in sequence
Dumbbell examples/dumbbell_demo.py Two free bodies, no static anchor
Joint types examples/joint_types_demo.py Spherical + Revolute (motorized) + Weld in one rig
Character mover examples/character_mover_demo.py Kinematic move-and-slide, outside the World's own physics
Debug draw examples/debug_draw_demo.py Pure-data wireframes, contacts, and joint anchors