Пример #1
0
 public void LoadData()
 {
     if (File.Exists("Game_Data.json"))
     {
         var gamedata = GameIO.ReadFromJsonFile <DataObjects.GameDataObject>("Game_Data.json");
         CouldLoadFile = true;
         GSV           = gamedata.GameSceneVariables;
         Tiles         = new PlantTile[gamedata.Tiles.GetLength(0), gamedata.Tiles.GetLength(1)];
         for (int i = 0; i != gamedata.Tiles.GetLength(0); i++)
         {
             for (int j = 0; j != gamedata.Tiles.GetLength(1); j++)
             {
                 Tiles[i, j]         = gamedata.Tiles[i, j];
                 Tiles[i, j].Terrain = new Terrain.DirtPatch();
                 Tiles[i, j].Terrain.Generate(GSV.TerrainDepth, GSV.TerrainWidth, GSV.TerrainPointSpacing, Graphics.GraphicsDevice);
             }
         }
     }
 }
Пример #2
0
 public Vector3 GenPositionForEntity(Entity NewEntity, GameSceneVariables GSV, ref Dictionary <string, List <Model> > sourceForModels)
 {
     return(new Vector3(Utils.RNG.Next(GSV.TerrainPointSpacing, GSV.TerrainPointSpacing * (GSV.TerrainWidth - 2)),
                        10,
                        Utils.RNG.Next(GSV.TerrainPointSpacing, GSV.TerrainPointSpacing * (GSV.TerrainWidth - 2))));
 }