Working on how i can make a vektor2, rotate around another vektor 2 using gravity like planets.

If you know the distance from the gravity sorce and calculate the new gravity from a certain distance.
if(planet gravity < stone gravity)
stone move more against the planet than the planet against the stone but they will collide if stone speed is to low around the planet.

if you put a gravity variable on the planet and a vector2. then putt a mass variable and a vector2 on the stone.
Then put a speed variable on the stone and calculate the G force to make the stone stay in orbit?

Anyone understand what my brain trying to do? :stuck_out_tongue:

Watch this video, it explaines exactly what your trying to do.

Watch “Coding Challenge #7: Solar System in Processing - Part 1 (2D)” on YouTube

1 Like