# 2D Physics Playground rigid bodies, a character, one-way platforms, and joints. ```{raw} html ▶ Run in browser ``` **Tags:** `physics` `2d` `character` `joints` One scene exercising the 2D physics stack end to end. Dynamic boxes and circles fall and pile on a static segment floor, a two-link pendulum swings from pin joints, a bead slides along a groove joint, and a player-controlled character walks, jumps, and lands on a one-way platform it can also jump up through from below. An Area2D trigger zone reports every body passing through it, the character included: a CharacterBody2D is an ordinary kinematic body, so it fires the same signals a falling box does. This is a Y-down pixel world (``gravity = Vec2(0, +g)``, +Y rendered downward), so falling reads as falling on screen. The character's ``up_direction`` and the one-way platform's solid side are flipped to -Y to match. Engine features shown: - PhysicsBody2D in DYNAMIC and STATIC modes with PhysicsMaterial friction and restitution; each body carries a CollisionShape2D plus a visual child that inherits the body transform the physics sync writes each fixed step. - CharacterBody2D driven by velocity + move_and_slide, with is_on_floor gating jumps. - A one-way platform: solid from above, pass-through from below. - Area2D body_entered / body_exited signals updating the HUD live, including the body_exited a DESTROYED body still owes: press X and the zone names what it lost. - PinJoint2D (a pendulum chain) and GrooveJoint2D (a bead pinned to a slide rail and kicked along it at start). Controls: A / D - move the character left / right Hold click or tap - walk the character toward the pointer (mouse / touch) Space, click, tap - jump R - respawn the falling batch X - destroy whatever is inside the trigger zone Escape - quit Run: uv run python examples/features/physics/playground2d.py Headless self-check: uv run python examples/features/physics/playground2d.py --test ## Source ```{literalinclude} ../../examples/features/physics/playground2d.py :language: python :linenos: ```