예제 #1
0
        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;
            }
        }
예제 #2
0
 public void ApplyGravity(Moon moon)
 {
     ApplyGravity(Dimension.X, moon);
     ApplyGravity(Dimension.Y, moon);
     ApplyGravity(Dimension.Z, moon);
 }