liabru/matter-js ? reverse-engineered prompt
Reverse engineered prompt
Build me a JavaScript 2D physics engine for the web that people can drop into a page and use to make simple games and interactive demos.
I want bodies that fall, bounce, stack, slide, and collide naturally, plus support for circles, rectangles, polygons, compound shapes, constraints, gravity, friction, sleeping, and events. It should also have a basic canvas renderer so I can see the simulation running right away, and a handful of demo scenes like stacks, bridges, a slingshot, a car, soft bodies, cloth, raycasting, and collision filtering.
Please make it work nicely in the browser, keep it usable from Node too, and include a clean example or two that shows how to create a world and step the simulation. If you need to look up current docs online, go ahead and do that.
Are you gonna build this?
make sure you review the code using coderabbit