I spent the last 5 weeks coding, fixing and golfing this project, thanks to Marcel Kießlich's (pixel_physics) Youtube channel and Amazon book.
I'm especially hyped for the springs and joints (that's the features I've wanted to implement since 2019).
I detailed all my process in the making-of.
I rewrote and optimized Marcel's code (63kb) into 20kb (commented), 2811b (minified/golfed) and 1448b gzipped.
A micro version (without joints) is also available (2174b minified, 1152b gzipped), much smaller and stabler than my 2019 project Mini2DPhysics, and with a few extra features, like customizable color and gravity for each shape!
I believe it's the World's smallest 2D physics engine in JS, but I'm sure it can still lose a few dozen bytes (with your help?)
The goal (of course) is to make it useable in
@js13kgames entries.
#screenshotsaturday (these are some other tests I've made during the development)
Cheers 😀