Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when implementing 2D physics interactions with Matter.js, including Engine/World setup, Render/Runner configuration, adding bodies and constraints, and scroll/interaction-friendly canvas scenes.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | -55% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -13% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-02 | ✓→✗ | ▼ Worse | 3% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 12% | 0% |
html<script> const { Engine, Render, Runner, Bodies, Composite } = Matter; const engine = Engine.create(); const render = Render.create({ element: document.body, engine: engine, options: { width: 800, height: 600, wireframes: false } }); const runner = Runner.create(); Runner.run(runner, engine); Render.run(render); const ground = Bodies.rectangle(400, 610, 810, 60, { isStatic: true }); const box = Bodies.rectangle(400, 200, 80, 80); Composite.add(engine.world, [ground, box]); </script>
Composite.add(engine.world, [...]) to add bodies to the world.Render.create({ element, engine }) to create a canvas automatically, or pass a canvas you create yourself.render.options.wireframes = false for solid rendering.Runner.run(runner, engine) for a simple loop, or call Engine.update in your own loop if you need custom timing.jsconst { Mouse, MouseConstraint } = Matter; const mouse = Mouse.create(render.canvas); const mouseConstraint = MouseConstraint.create(engine, { mouse }); Composite.add(engine.world, mouseConstraint); render.mouse = mouse;
Runner.stop(runner).Other measured skills in the registry, with their headline benchmark lift.