コード例 #1
0
ファイル: LevelGenerator.cs プロジェクト: mokujin/DN
        public void Generate(GameWorld gameWorld)
        {
            restart:
            try
            {
                TileMap = gameWorld.TileMap;

                Width = (int)Math.Round(TileMap.Width * Scale);
                Height = (int)Math.Round(TileMap.Height * Scale);

                Map = new CellType[Width, Height];
                Stage = Stage.Nothing;
                _miners.Clear();

                ResourseMap = new ResourseMap(Width, Height);
                TileMap.FillWith(Map, Width, Height, CellType.Wall);
            }
               catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                TileMap.PrintDebug();
                goto restart;
            }
        }