(Rough) Newtonian Gravity Simulator

Hello! I have a new project again, a Newtonian gravity simulator made (almost entirely) from memory (because I made this in C# and Raylib yesterday). It is likely not perfect, I notice some issues that I can't quite work out, so please tell me how I can improve it if you can!

um what

It's super cool! Much better than anything I could do.
I have a question, though- is there a way to (how do I say this) time-lapse it? As in run the simulation faster? I would be interested in seeing the program run for a long time, but I don't have the time (haha).

Oddly enough, it runs the fastest for me when I have both turbo mode and visible stepping enabled. No idea why though

Hmm. I just tried it out, and that happens for me too. Thanks!

Single stepping, ?incidentally?, acts as the Live coding support (experimental)Shift, which usually speeds things up a bit by not copying the thread bodies.

Also this functions is twice as fast as original one (9-12 > 4 ms)
untitled script pic - 2022-05-11T213109.285

I just did scenario 1 with gravity 10, and they got slingshot-ed all over the stage.

That would compromise the accuracy of the simulation, also no sadly.

Thank you, it's been updated, I've been able to do this in C# but I wasn't sure if I was able to add lists together like that in Snap!.

Makes sense.

UPDATE
Planets can now collide and merge.

ANOTHER UPDATE
You can zoom in and out with + and -
You can pan using WASD.

Although the Snap! stage is two-dimensional, actual planets are three-dimensional, so shouldn't the size (the linear measure) of a planet be the cube root of its mass, not the square root?