Пример #1
0
        public void Perform()
        {
            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            Ground.I.Music.Title.Play();

            string[] items = new string[]
            {
                "ゲームスタート",
                "迷路の設定",
                "設定",
                "終了",
            };

            int selectIndex = 0;

            this.SimpleMenu = new DDSimpleMenu();

            this.SimpleMenu.WallColor   = WALL_COLOR;
            this.SimpleMenu.BorderColor = new I3Color(30, 30, 30);
            //this.SimpleMenu.WallPicture = Ground.I.Picture.TitleWall;

            for (; ;)
            {
                selectIndex = this.SimpleMenu.Perform("Dungeon", items, selectIndex);

                switch (selectIndex)
                {
                case 0:
                {
                    DungeonMap dungMap = null;

                    ThreadEx th = new ThreadEx(() =>
                        {
                            dungMap = new DungeonMapMaker().MakeDungeonMap(
                                Ground.I.MakeMap_W,
                                Ground.I.MakeMap_H,
                                Ground.I.MakeMap_Seed
                                );
                        });

                    for (int c = 0; ; c++)
                    {
                        if (30 < c && th.IsEnded())
                        {
                            break;
                        }

                        this.DrawWall();

                        DDPrint.SetPrint(10, 10);
                        DDPrint.SetBorder(new I3Color(128, 64, 0));
                        DDPrint.Print("マップデータ作成中...");
                        DDPrint.Reset();

                        DDEngine.EachFrame();
                    }
                    this.LeaveTitleMenu();

                    using (Game game = new Game())
                    {
                        game.Map = MapLoader.Load(dungMap);
                        game.Perform();
                    }
                    this.ReturnTitleMenu();
                }
                break;

                case 1:
                    this.MakeMapSetting();
                    break;

                case 2:
                    this.Setting();
                    break;

                case 3:
                    goto endMenu;

                default:
                    throw new DDError();
                }
            }
endMenu:
            DDEngine.FreezeInput();
            DDMusicUtils.Fade();
            DDCurtain.SetCurtain(30, -1.0);

            foreach (DDScene scene in DDSceneUtils.Create(40))
            {
                this.DrawWall();
                DDEngine.EachFrame();
            }
        }