Esempio n. 1
0
 protected override void InitializeNestedBodies()
 {
     if (NestedBodies.Count == 0)
     {
         //Add the other parts of the SolarSystem
         Vector3 OrbitalPlaneNormal = Manager.GetRandomNormal();
         int     NumPlanets         = MyGame.random.Next(7, 10);
         for (int i = 0; i < NumPlanets; i++)
         {
             NestedBodies.Add(new Planet(Manager.GetRandomNormal() * (float)(Transforms.Scale + 0.9 * MyGame.random.NextDouble())
                                         , Transforms.Scale * 0.1f * (float)MyGame.random.NextDouble()
                                         , Mass
                                         , OrbitalPlaneNormal));
         }
         int NumAsteroids = MyGame.random.Next(1, 4);
         for (int i = 0; i < NumAsteroids; i++)
         {
             NestedBodies.AddRange(
                 Asteroid.CreateBelt(
                     Transforms.Scale + 0.9f * (float)MyGame.random.NextDouble()
                     , Transforms.Scale * (0.5f + 0.5f * (float)MyGame.random.NextDouble())
                     , Transforms.Scale * (0.1f + 0.1f * (float)MyGame.random.NextDouble())
                     , Manager.GetRandomNormal()
                     , MyGame.random.Next(1, 4)
                     , Mass));
         }
     }
 }
Esempio n. 2
0
 protected override void InitializeNestedBodies()
 {
     if (NestedBodies.Count == 0)
     {
         int NumSystems = MyGame.random.Next(7, 13);
         NestedBodies.Add(new SolarSystem(Vector3.Zero));
         for (int i = 1; i < NumSystems; i++)
         {
             NestedBodies.Add(new SolarSystem(75.0f * Manager.GetRandomNormal() * (float)MyGame.random.NextDouble()));
         }
     }
 }
Esempio n. 3
0
 protected override void InitializeNestedBodies()
 {
     if (NestedBodies.Count == 0)
     {
         //Add some Moons
         int NumMoons = MyGame.random.Next(2, 5);
         for (int i = 0; i < NumMoons; i++)
         {
             NestedBodies.Add(new Moon(Manager.GetRandomNormal() * (float)(Transforms.Scale + Transforms.Scale * MyGame.random.NextDouble())
                                       , (float)(Transforms.Scale * 0.1 * MyGame.random.NextDouble())
                                       , Mass));
         }
     }
 }