- For each rock calculate the gravity to each spaceship, fuel, missile, sun, workhole, alienship etc and move the rock
The spaceships are exerting gravity on the rocks? That doesn't make sense to me... *scratches head*
Let's think logically about space physics - start at the top and work our way down -which object has the most mass?
The black hole, of course.
Then, the sun
then the rocks, assuming they're huge
IMO, spaceships/"fuel"/missiles/ should not exert gravity as they just dont have the mass, and i would argue that 'wormholes' have no mass at all and therefore no gravity.
So if you want a really dynamic and "living" model, you could step through your physics logic in order:
Black hole in the middle, exerting gravity on the sun. sun orbiting black hole
Sun exerting gravity on the rocks, causing them to orbit the sun
rocks exerting gravity on everything else that's smaller.
Assuming theres enough distance between your celestial objects, and your math/physics calculations are sound, what youl end up with is essentially a living-breathing solar system. You know, minus the black hole. Naturally more than one gravitational pull could apply to any given small object, and so youd have to calculate which pull is stronger based on distance/mass of celestial object.. etc.
Sounds complicated but if you work it out logically and code it in a modular fashion, it should work out fine. If i wasn't on my way to bed and half asleep, id write ya some pseudocode. Maybe tomorrow hehe. hope this helps.
"None are more hopelessly enslaved than those who falsely believe they are free."
"It is no measure of health to be well adjusted to a profoundly sick society."
"Hope is the first step on the road to dissapointment." -Jonah Orionhttp://tankzgame.blogspot.com