Пример #1
0
 // Constructor
 public Treasure(Stage stage, string label, string meshFile, int nTreasure)
     : base(stage, label, meshFile)
 {
     random = new Random();
     addObject(new Vector3(447 * stage.Spacing, stage.Terrain.surfaceHeight(447, 453) + heightSpacing, 453 * stage.Spacing), Vector3.Up, 0.79f, scale);
     for (int i = 1; i < nTreasure; i++)
     {
         int x = (128 + random.Next(256)) * stage.Spacing;  // 128 .. 384
         int z = (128 + random.Next(256)) * stage.Spacing;
         addObject(
             new Vector3(x, stage.surfaceHeight(x, z) + heightSpacing, z),
             Vector3.Up, 1.57f,
             scale);
     }
 }
Пример #2
0
 // Constructor
 public Cloud(Stage stage, string label, string meshFile, int nClouds)
     : base(stage, label, meshFile)
 {
     random = new Random();
     // add nClouds random cloud instances
     for (int i = 0; i < nClouds; i++)
     {
         int x = (128 + random.Next(256)) * stage.Spacing;          // 128 .. 384
         int z = (128 + random.Next(256)) * stage.Spacing;
         addObject(
             new Vector3(x, stage.surfaceHeight(x, z) + 4000, z),
             new Vector3(0, 1, 0), (random.Next(5)) * 0.01f,
             new Vector3(4 + random.Next(3), random.Next(4) + 1, 3 + random.Next(2)));
     }
 }