A moon is a body that orbits another body instead of its star. Its position is its planet's position plus its own orbit, and its orbital period comes from its planet's mass. Worldgen places some moons around planets from the start, and Moon Capture adds more when a light body comes near a much heavier one. A body that orbits another is always a moon, whatever it is made of.
Behaviour
- Moons go one level deep: a moon has no moons of its own.
- The heavier body is always the one orbited. A moon that outgrows its planet swaps places with it: the moon circles the star, and the old planet and its other moons circle the moon. No body changes position in the swap.
- A moon follows what remains of its planet: the merged body if its planet is absorbed, the debris if it breaks, and the new system if it is flung out.
A body's kind is checked again whenever a world event changes it.