public void ApplyGravity(Dimension dimension, Moon moon) { if (Position[dimension] < moon.Position[dimension]) { Velocity[dimension] += 1; moon.Velocity[dimension] -= 1; } if (Position[dimension] > moon.Position[dimension]) { Velocity[dimension] -= 1; moon.Velocity[dimension] += 1; } }
public void ApplyGravity(Moon moon) { ApplyGravity(Dimension.X, moon); ApplyGravity(Dimension.Y, moon); ApplyGravity(Dimension.Z, moon); }