This is a very early version of a particle sim that I have been experimenting with and working on for a while. The particles are attracted to each other by gravity and all of the physics is 100% accurate :D Although this is cool there are still lots of things to be done and many additions that I plan to make so feel free to follow along as I develop it. Controls: WASD to look around adjust the gravity slider to change how much the particles are attracted to each other. for those of you who are physics nerds like me, this is a short summary of how it works. First, 50 clones are created and each clone has its own ID, which is used to index lists to find all of its data, EX: the X position of particle #13 can be found in the 13th place of the X list. then, each clone must find the gravitational force exerted on itself from every other particle using this process: 1. find the distance between the two particles using the Pythagorean theorem 2. Calculate the gravitational force using (M*m*G)/r^2 3. Find the angle from the 1st particle to the second particle using the arctan function 4. Use the angle to split the force into X and Y vectors 5. change the X and Y velocities by the vector amounts Now that one particle has performed those calculations for one other particle, it must repeat that another 49 times and then use its final velocity to change its position. Then each of the 50 particles must do those 50 calculations. all in all this happens 2500 times per frame :D because I have not yet added collisions, you might see particles get close to each other and then zip off into oblivion due to intense forces at close distance.
All by me Run in Turbowarp for slightly better fps