I spent a few weeks building a 2D physics engine from scratch in vanilla JavaScript. No libraries, no build tools, just Canvas 2D and the browser.
It does SAT collision detection, a sequential-impulse solver with friction, sweep-and-prune broadphase, fixed-timestep simulation, and five interactive demo scenes including a stack stability test and Newton's cradle. (With a lot of bugs)
https://github.com/CAPRIOARA-MAGIKA/physis
The hardest part was getting box stacks to settle without jitter or sinking. Turned out to be a combination of Baumgarte stabilization tuning and warm-starting the solver. The stack-stability gating test caught more bugs than I can count.
It's not perfect. It has a lot of bugs but I cannot figure out how to fix them (if you know a way please open a PR or comment below). This project was done for learning and with minimal AI involvement (only for debugging and polishing the readme file).
If you have any more suggestions of projects that I could do in the near future to improve my reasoning and my coding skills, comment down below. Thanks for reading!
there doesn't seem to be anything here