Quick tips: That's all you need to get started, I think. The rest should be self-explanatory. Let me know if it's not!

Bad Gravity is a small simulator I made because I had a very hard time finding an existing minigame where I can just pilot a ship without installing software, perhaps buying it, then building a rocket that must first make it into orbit... I just had questions about orbital mechanics that online videos weren't answering and I figured: how hard could this be to make? Well... here we are :)

Time controls. The simulation always tries to do 60 runs per second, but in every run you can do multiple steps. In a step, the amount of attraction that each body feels towards each other is updated, their positions are updated, and the line is drawn. By doing more steps per run, the simulation runs faster, but your computer is limited in how many steps it can do before at 60 runs per second. To speed up further, the time per step control lets you increase the amount of time that passes in each step, but it gets less precise because there is more distance between each time the forces are calculated.

Spacebar creates a light body, pushed from A into the direction of the mouse. It was meant to simulate: what would happen if you shoot a bullet from a spacecraft? If A is moving relative to your target, it's no bug that the new body doesn't move directly towards the mouse!

Units Thanks to Paul Lutus over at https://arachnoid.com/orbital_dynamics/ for releasing their code as GPLv2! Their simulation is written in a straightforward manner that made it perfect to learn from. Also special thanks to my good friend Frédéric for frequent feedback and expert advice on anything game-dev related. Even Bad Gravity was not made in isolation :-)

Links that might interest you: More info about me is available at /