3 ms·
I really like the idea to just use a physics engine as a means of randomizing the layout. Smart, succinct, and easy to implement.
by carlisle_ 11y ago
I really like the idea to just use a physics engine as a means of randomizing the layout. Smart, succinct, and easy to implement.
- neolefty 11y agoI delighted in this article because of its opinions about what is easy and what is hard. Physics engine: easy; of course you have one; everyone has a physics engine. Graph data structure & algos: suggests a few places to find one. As an older programmer who is in the midst of retooling, I would assume the opposite: graphs easy, physics hard. But that's what retooling seems to be all about -- finding the new "easy" and learning it.
- yoklov 11y agoA physics system good enough to support this is probably ~200loc. Probably less if you cut out everything extraneous. All it is is AABB collision detection+resolution, and then some update code. I think the graph + graph algos would be trickier most of the time, but that could just be since I've written the above code many, many times.