Exemplo n.º 1
0
        public static void SaveGame(GameStatus gameStatus)
        {
            SaveGame_幕間();

            DDEngine.FreezeInput();

            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            DDSimpleMenu simpleMenu = new DDSimpleMenu();

            simpleMenu.BorderColor = new I3Color(0, 128, 0);
            simpleMenu.WallColor   = new I3Color(128, 64, 0);

            int selectIndex = 0;

            for (; ;)
            {
                // セーブしたら戻ってくるので、毎回更新する。
                string[] items = Ground.I.SaveDataSlots.Select(v => v.GameStatus == null ?
                                                               "----" :
                                                               "[" + v.TimeStamp + "] " + v.Description).Concat(new string[] { "戻る" }).ToArray();

                selectIndex = simpleMenu.Perform("セーブ画面", items, selectIndex);

                if (selectIndex < Consts.SAVE_DATA_SLOT_NUM)
                {
                    if (new Confirm()
                    {
                        BorderColor =
                            Ground.I.SaveDataSlots[selectIndex].GameStatus != null ?
                            new I3Color(200, 0, 0) :
                            new I3Color(100, 100, 0)
                    }
                        .Perform(
                            Ground.I.SaveDataSlots[selectIndex].GameStatus != null ?
                            "スロット " + (selectIndex + 1) + " のデータを上書きします。" :
                            "スロット " + (selectIndex + 1) + " にセーブします。", "はい", "いいえ") == 0)
                    {
                        Ground.P_SaveDataSlot saveDataSlot = Ground.I.SaveDataSlots[selectIndex];

                        saveDataSlot.TimeStamp   = DateTime.Now.ToString("yyyy/MM/dd (ddd) HH:mm:ss");
                        saveDataSlot.Description = "@@@~~~@@@~~~@@@~~~@@@~~~@@@";
                        saveDataSlot.MapName     = GameCommon.GetMapName(Game.I.Map.MapFile, "t0001");
                        saveDataSlot.GameStatus  = gameStatus;
                    }
                }
                else                 // [戻る]
                {
                    break;
                }
                //DDEngine.EachFrame(); // 不要
            }

            SaveGame_幕間();

            DDEngine.FreezeInput();
        }
Exemplo n.º 2
0
        private Ground.P_SaveDataSlot LoadGame()         // ret: null == キャンセル, ret.GameStatus を使用する際は GetClone を忘れずに!
        {
            Ground.P_SaveDataSlot saveDataSlot = null;

            DDEngine.FreezeInput();

            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            // old
            //DDSimpleMenu simpleMenu = new DDSimpleMenu()
            //{
            //    BorderColor = new I3Color(0, 128, 0),
            //    WallDrawer = () =>
            //    {
            //        DDDraw.SetBright(new I3Color(64, 64, 128));
            //        DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, 0, DDConsts.Screen_W, DDConsts.Screen_H);
            //        DDDraw.Reset();
            //    },
            //};

            string[] items = Ground.I.SaveDataSlots.Select(v => v.GameStatus == null ?
                                                           "----" :
                                                           "[" + v.TimeStamp + "] " + v.Description).Concat(new string[] { "戻る" }).ToArray();

            int selectIndex = 0;

            for (; ;)
            {
                selectIndex = this.SimpleMenu.Perform(18, 18, 32, 24, "ロード", items, selectIndex);

                if (selectIndex < Consts.SAVE_DATA_SLOT_NUM)
                {
                    if (Ground.I.SaveDataSlots[selectIndex].GameStatus != null)
                    {
                        if (new Confirm()
                        {
                            BorderColor = new I3Color(50, 100, 200)
                        }
                            .Perform("スロット " + (selectIndex + 1) + " のデータをロードします。", "はい", "いいえ") == 0)
                        {
                            saveDataSlot = Ground.I.SaveDataSlots[selectIndex];
                            break;
                        }
                    }
                }
                else                 // [戻る]
                {
                    break;
                }
                //DDEngine.EachFrame(); // 不要
            }
            DDEngine.FreezeInput();

            return(saveDataSlot);
        }
Exemplo n.º 3
0
        private static Ground.P_SaveDataSlot LoadGame()         // ret: null == キャンセル, ret.GameStatus を使用する際は GetClone を忘れずに!
        {
            Ground.P_SaveDataSlot saveDataSlot = null;

            DDEngine.FreezeInput();

            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            DDSimpleMenu simpleMenu = new DDSimpleMenu();

            simpleMenu.BorderColor = new I3Color(0, 128, 0);
            simpleMenu.WallColor   = new I3Color(64, 64, 128);

            string[] items = Ground.I.SaveDataSlots.Select(v => v.GameStatus == null ?
                                                           "----" :
                                                           "[" + v.TimeStamp + "] " + v.Description).Concat(new string[] { "戻る" }).ToArray();

            int selectIndex = 0;

            for (; ;)
            {
                selectIndex = simpleMenu.Perform("ロード画面", items, selectIndex);

                if (selectIndex < Consts.SAVE_DATA_SLOT_NUM)
                {
                    if (Ground.I.SaveDataSlots[selectIndex].GameStatus != null)
                    {
                        if (new Confirm()
                        {
                            BorderColor = new I3Color(50, 100, 200)
                        }
                            .Perform("スロット " + (selectIndex + 1) + " のデータをロードします。", "はい", "いいえ") == 0)
                        {
                            saveDataSlot = Ground.I.SaveDataSlots[selectIndex];
                            break;
                        }
                    }
                }
                else                 // [戻る]
                {
                    break;
                }
                //DDEngine.EachFrame(); // 不要
            }
            DDEngine.FreezeInput();

            return(saveDataSlot);
        }
Exemplo n.º 4
0
        public void Perform()
        {
            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

            DDEngine.FreezeInput();

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

            this.SimpleMenu = new DDSimpleMenu()
            {
                BorderColor = new I3Color(0, 96, 0),
                WallDrawer  = this.DrawWall.Execute,
            };

            this.TopMenu.SelectIndex = 0;

            for (; ;)
            {
                if (DDInput.DIR_8.IsPound())
                {
                    this.TopMenu.SelectIndex--;
                }

                if (DDInput.DIR_2.IsPound())
                {
                    this.TopMenu.SelectIndex++;
                }

                this.TopMenu.SelectIndex += TopMenuTask.ITEM_NUM;
                this.TopMenu.SelectIndex %= TopMenuTask.ITEM_NUM;

                if (DDInput.A.GetInput() == 1)                 // ? 決定ボタン押下
                {
                    switch (this.TopMenu.SelectIndex)
                    {
                    case 0:
                    {
                        this.LeaveTitleMenu();

                        using (new WorldGameMaster())
                        {
                            WorldGameMaster.I.World  = new World("Start");
                            WorldGameMaster.I.Status = new GameStatus();
                            WorldGameMaster.I.Perform();
                        }
                        this.ReturnTitleMenu();
                    }
                    break;

                    case 1:
                    {
                        this.DrawWall.DeepConfigEntered = true;
                        Ground.P_SaveDataSlot saveDataSlot = LoadGame();
                        this.DrawWall.DeepConfigEntered = false;

                        if (saveDataSlot != null)
                        {
                            this.LeaveTitleMenu();

                            using (new WorldGameMaster())
                            {
                                WorldGameMaster.I.World  = new World(saveDataSlot.MapName);
                                WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone();
                                WorldGameMaster.I.Status.StartPointDirection = 101;                                                 // スタート地点を「ロード地点」にする。
                                WorldGameMaster.I.Perform();
                            }
                            this.ReturnTitleMenu();
                        }
                    }
                    break;

                    case 2:
                        this.DrawWall.TopMenuLeaved = true;

                        using (new SettingMenu()
                        {
                            SimpleMenu = this.SimpleMenu,
                            SetDeepConfigEntered = flag => this.DrawWall.DeepConfigEntered = flag,
                        })
                        {
                            SettingMenu.I.Perform();
                        }
                        this.DrawWall.TopMenuLeaved = false;
                        break;

                    case 3:
                        goto endMenu;

                    default:
                        throw new DDError();
                    }
                }
                if (DDInput.B.GetInput() == 1)                 // ? キャンセルボタン押下
                {
                    if (this.TopMenu.SelectIndex == TopMenuTask.ITEM_NUM - 1)
                    {
                        break;
                    }

                    this.TopMenu.SelectIndex = TopMenuTask.ITEM_NUM - 1;
                }

                this.DrawWall.Execute();
                this.TopMenu.Execute();

                DDEngine.EachFrame();
            }
endMenu:
            DDMusicUtils.Fade();
            DDCurtain.SetCurtain(30, -1.0);

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

            DDEngine.FreezeInput();
        }
Exemplo n.º 5
0
        public void Perform()
        {
            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

            DDEngine.FreezeInput();

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

            string[] items = new string[]
            {
                "ゲームスタート(ほむら)",
                "ゲームスタート(さやか)",
                "コンテニュー",
                "設定",
                "終了",
            };

            int selectIndex = 0;

            this.SimpleMenu = new DDSimpleMenu();

            this.SimpleMenu.BorderColor = new I3Color(64, 0, 0);
            //this.SimpleMenu.WallColor = new I3Color(96, 0, 0);
            this.SimpleMenu.WallPicture = Ground.I.Picture.Title;
            this.SimpleMenu.WallCurtain = -0.8;

            for (; ;)
            {
                selectIndex = this.SimpleMenu.Perform("横スクロール アクションゲーム タイプ-K テストコード / タイトルメニュー", items, selectIndex);

                switch (selectIndex)
                {
                case 0:
                {
                    this.LeaveTitleMenu();

                    using (new WorldGameMaster())
                    {
                        WorldGameMaster.I.World  = new World("t0001");                                        // 仮?
                        WorldGameMaster.I.Status = new GameStatus();
                        WorldGameMaster.I.Perform();
                    }
                    this.ReturnTitleMenu();
                }
                break;

                case 1:
                {
                    this.LeaveTitleMenu();

                    using (new WorldGameMaster())
                    {
                        WorldGameMaster.I.World  = new World("t0001");                                        // 仮?
                        WorldGameMaster.I.Status = new GameStatus()
                        {
                            StartChara = Player.Chara_e.SAYAKA,
                        };
                        WorldGameMaster.I.Perform();
                    }
                    this.ReturnTitleMenu();
                }
                break;

                case 2:
                {
                    Ground.P_SaveDataSlot saveDataSlot = LoadGame();

                    if (saveDataSlot != null)
                    {
                        this.LeaveTitleMenu();

                        using (new WorldGameMaster())
                        {
                            WorldGameMaster.I.World  = new World(saveDataSlot.MapName);
                            WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone();
                            WorldGameMaster.I.Status.StartPointDirection = 101;                                             // スタート地点を「ロード地点」にする。
                            WorldGameMaster.I.Perform();
                        }
                        this.ReturnTitleMenu();
                    }
                }
                break;

                case 3:
                    this.Setting();
                    break;

                case 4:
                    goto endMenu;

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

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

            DDEngine.FreezeInput();
        }
Exemplo n.º 6
0
        public void Perform()
        {
            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

            DDEngine.FreezeInput();

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

            string[] items = new string[]
            {
                "ゲームスタート",
                "コンテニュー",
                "設定",
                "終了",
            };

            int selectIndex = 0;

            this.SimpleMenu = new DDSimpleMenu()
            {
                BorderColor = new I3Color(64, 0, 0),
                WallDrawer  = () =>
                {
                    DDPicture picture = Ground.I.Picture.Title;

                    DDDraw.DrawRect(
                        picture,
                        DDUtils.AdjustRectExterior(picture.GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H))
                        );

                    DDDraw.SetMosaic();
                    DDDraw.DrawBegin(
                        Ground.I.Picture.PlayerStands[DDEngine.ProcFrame / 120 % 2][DDEngine.ProcFrame / 30 % 2],
                        610,
                        392
                        );
                    DDDraw.DrawZoom_X(-1.0);
                    DDDraw.DrawZoom(14.0);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DDCurtain.DrawCurtain(-0.4);
                },
            };

            for (; ;)
            {
                selectIndex = this.SimpleMenu.Perform(40, 40, 40, 24, "横スクロール アクション ゲーム(仮)", items, selectIndex);

                bool cheatFlag;

                {
                    int bk_freezeInputFrame = DDEngine.FreezeInputFrame;
                    DDEngine.FreezeInputFrame = 0;
                    cheatFlag = 1 <= DDInput.DIR_6.GetInput();
                    DDEngine.FreezeInputFrame = bk_freezeInputFrame;
                }

                switch (selectIndex)
                {
                case 0:
                    if (DDConfig.LOG_ENABLED && cheatFlag)
                    {
                        this.CheatMainMenu();
                    }
                    else
                    {
                        this.LeaveTitleMenu();

                        using (new WorldGameMaster())
                        {
                            WorldGameMaster.I.World  = new World("Start");
                            WorldGameMaster.I.Status = new GameStatus();
                            WorldGameMaster.I.Perform();
                        }
                        this.ReturnTitleMenu();
                    }
                    break;

                case 1:
                {
                    Ground.P_SaveDataSlot saveDataSlot = LoadGame();

                    if (saveDataSlot != null)
                    {
                        this.LeaveTitleMenu();

                        using (new WorldGameMaster())
                        {
                            WorldGameMaster.I.World  = new World(saveDataSlot.MapName);
                            WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone();
                            WorldGameMaster.I.Status.StartPointDirection = 101;                                             // スタート地点を「ロード地点」にする。
                            WorldGameMaster.I.Perform();
                        }
                        this.ReturnTitleMenu();
                    }
                }
                break;

                case 2:
                    using (new SettingMenu()
                    {
                        SimpleMenu = this.SimpleMenu,
                    })
                    {
                        SettingMenu.I.Perform();
                    }
                    break;

                case 3:
                    goto endMenu;

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

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

            DDEngine.FreezeInput();
        }
Exemplo n.º 7
0
        public void Perform()
        {
            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

            DDEngine.FreezeInput();

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

            string[] items = new string[]
            {
                "ゲームスタート",
                "コンテニュー",
                "設定",
                "終了",
            };

            int selectIndex = 0;

            this.SimpleMenu = new DDSimpleMenu()
            {
                BorderColor = new I3Color(64, 0, 0),
                WallDrawer  = () =>
                {
                    DDPicture picture = Ground.I.Picture.Title;

                    DDDraw.DrawRect(
                        picture,
                        DDUtils.AdjustRectExterior(picture.GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H))
                        );

                    DDCurtain.DrawCurtain(-0.4);
                },
            };

            for (; ;)
            {
                selectIndex = this.SimpleMenu.Perform(40, 40, 40, 24, "横スクロール アクションゲーム タイプ-M テストコード / タイトルメニュー", items, selectIndex);

                switch (selectIndex)
                {
                case 0:
                {
                    this.LeaveTitleMenu();

                    using (new WorldGameMaster())
                    {
                        WorldGameMaster.I.World  = new World("t0001");                                        // マップ名_仮?
                        WorldGameMaster.I.Status = new GameStatus();
                        WorldGameMaster.I.Perform();
                    }
                    this.ReturnTitleMenu();
                }
                break;

                case 1:
                {
                    Ground.P_SaveDataSlot saveDataSlot = LoadGame();

                    if (saveDataSlot != null)
                    {
                        this.LeaveTitleMenu();

                        using (new WorldGameMaster())
                        {
                            WorldGameMaster.I.World  = new World(saveDataSlot.MapName);
                            WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone();
                            WorldGameMaster.I.Status.StartPointDirection = 101;                                             // スタート地点を「ロード地点」にする。
                            WorldGameMaster.I.Perform();
                        }
                        this.ReturnTitleMenu();
                    }
                }
                break;

                case 2:
                    using (new SettingMenu()
                    {
                        SimpleMenu = this.SimpleMenu,
                    })
                    {
                        SettingMenu.I.Perform();
                    }
                    break;

                case 3:
                    goto endMenu;

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

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

            DDEngine.FreezeInput();
        }