Пример #1
0
        protected override void ButtonUpdate()
        {
            if (button[0].isSelected && (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8)))           // Continue
            {
                SoundControl.Stop();
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }


                //SoundControl.Pause();//SoundControl.Stop();
                //isEndScene = true;
                nowLoading = true;
            }
            if (button[1].isSelected && (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8)))           // Back to Menu
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                SoundControl.Stop();
                SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
                //isEndScene = true;

                //BackScene(game.stageNum + 4);//5
                game.hasReachedCheckPoint = false;
                game.tmpGameStatus        = new GameStatus();
                game.InitializeStack();
            }
            if ((!game.twoButtonMode && JoyStick.KEY(2) || game.twoButtonMode && JoyStick.KEY(5)) && game.avilityNum == 0)
            {
                if ((upperScene as Stage).reverse.ReduceTAS() != 0)
                {
                    SoundControl.Stop();
                    SoundControl.RestoreMusic();
                    SoundControl.Resume();
                    if (!game.isMuted)
                    {
                        (upperScene as Stage).reverse.PlaySound();
                    }
                    isEndScene = true;
                    (upperScene as Stage).player.isAlive         = true;
                    (upperScene as Stage).toGameOver             = false;
                    (upperScene as Stage).hasEffectedPlayerDeath = false;
                    (upperScene as Stage).reverse.StartReverse();
                    (upperScene as Stage).ResetDeathEffect();
                }
            }

            if (hasDisplayed)
            {
                game.ReloadStage(game.isHighLvl);
                isEndScene = true;
            }
        }
Пример #2
0
        protected override void ButtonUpdate()
        {
            if (JoyStick.IsOnKeyDown(3) || JoyStick.IsOnKeyDown(8))
            {
                isEndScene = true;
                if (!game.isMuted)
                {
                    cancel.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }

            if (KeyInput.IsOnKeyDown(Microsoft.Xna.Framework.Input.Keys.T))
            {
                if (!game.inDebugMode)
                {
                    game.inDebugMode = true;
                }
                else if (game.inDebugMode)
                {
                    game.inDebugMode = false;
                }
            }

            if (button[0].isSelected && JoyStick.IsOnKeyDown(1))                        // Resume
            {
                isEndScene = true;
                (upperScene as Stage).isPausing = false;

                if (!game.isMuted)
                {
                    SoundControl.Resume();
                }
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }

            /*if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) {		// Option
             *      PushScene(new Option(this));
             *      if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f);
             * }*/

            if (button[1].isSelected && JoyStick.IsOnKeyDown(1))                        // to Menu
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
                if (!game.isMuted)
                {
                    SoundControl.Play();
                }
                BackScene(4);
            }

            if (button[2].isSelected && JoyStick.IsOnKeyDown(1))                        // to DebugMenu
            {
                PushScene(new DebugMenu(this, (upperScene as Stage)));
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }

            /*if (button[3].isSelected && JoyStick.IsOnKeyDown(1)) {		// Exit
             *      game.Exit();
             *      if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f);
             * }*/
        }