void MainMenu_SelectChoice(ScrollChoice choice)
        {
            switch (choice.Name)
            {
            case "play":
                //Engine.Instance.Audio.StopAllMusic();
                Engine.Instance.Audio.PlaySound("bonusHit");
                Engine.Instance.ActiveState = new GameOptions();
                break;

            case "fullscreen":
                Engine.Instance.Graphics.IsFullScreen = !Engine.Instance.Graphics.IsFullScreen;;
                Engine.Instance.Graphics.ApplyChanges();
                break;

            case "credits":
                //Engine.Instance.Audio.StopAllMusic();
                Engine.Instance.Audio.PlaySound("bonusHit");
                Engine.Instance.ActiveState = new Credits(this);
                break;

            case "exit":
                Engine.Instance.Game.Exit();
                break;

            default:
                throw new CaseStatementMissingException();
            }
        }
示例#2
0
        void MainMenu_SelectChoice(ScrollChoice choice)
        {
            switch (choice.Name)
            {
            case "play":
                Engine.Instance.ActiveState = new GameOptions();
                break;

            case "highScores":
                Engine.Instance.ActiveState = new HighScoreMenu(false);
                break;

            case "options":
                Engine.Instance.ActiveState = new OptionsMenu();
                break;

            case "credits":
                Engine.Instance.ActiveState = new Credits();
                break;

            case "exit":
                Exit();
                break;

            default:
                throw new CaseStatementMissingException();
            }
        }
        void OptionsMenu_SelectChoice(ScrollChoice choice)
        {
            switch (choice.Name)
            {
            case "back":
                SettingsMgr.Instance.Save();
                Engine.Instance.ActiveState = new MainMenu(false);
                break;

            default:
                // Do nothing
                break;
            }
        }
        void OptionsMenu_SelectionChanged(ScrollChoice oldChoice, ScrollChoice newChoice)
        {
            switch (oldChoice.Name)
            {
            case "music":
                SettingsMgr.Instance.EnableMusic = oldChoice.SelectedValue == "Yes";
                MP3MusicMgr.Instance.EnableMusic = SettingsMgr.Instance.EnableMusic;
                break;

            case "fullscreen":
                if (Engine.Instance.Graphics.IsFullScreen != (oldChoice.SelectedValue == "Yes"))
                {
                    SettingsMgr.Instance.IsFullScreen = oldChoice.SelectedValue == "Yes";
                    Resolution.SetResolution(1280, 800, SettingsMgr.Instance.IsFullScreen);
                    Engine.Instance.Graphics.ApplyChanges();
                }
                break;

            case "showSpawnTimer":
                SettingsMgr.Instance.ShowSpawnTimer = oldChoice.SelectedValue == "Yes";
                break;

            case "ctrlType":
                SettingsMgr.Instance.ControlType1 = (eControlType)oldChoice.SelectedValueIdx;
                break;

            case "skipTutorial":
                SettingsMgr.Instance.SkipTutorial = oldChoice.SelectedValue == "Yes";
                break;

            case "showRoundGUI":
                SettingsMgr.Instance.ShowRoundGUI = oldChoice.SelectedValue == "Yes";
                break;

            case "roundGUIAlpha":
                SettingsMgr.Instance.RoundGUIAlpha = byte.Parse(oldChoice.SelectedValue);
                break;

            case "back":
                // Do nothing
                break;

            default:
                throw new CaseStatementMissingException();
            }
        }
        void GameOptions_SelectChoice(ScrollChoice choice)
        {
            switch (choice.Name)
            {
            case "play":
                Level.Instance = new Level(int.Parse(GetChoiceByName("playerCnt").SelectedValue));
                Level.Instance.NextLevel(int.Parse(GetChoiceByName("level").SelectedValue) - 1);
                Engine.Instance.Audio.PlaySound("bonusHit");
                Engine.Instance.ActiveState = Level.Instance;
                break;

            case "back":
                Engine.Instance.Audio.PlaySound("bonusHit");
                Engine.Instance.ActiveState = new MainMenu();
                break;

            default:
                // Do nothing
                break;
            }
        }
 void GameOptions_SelectionChanged(ScrollChoice oldChoice, ScrollChoice newChoice)
 {
     ScoreModifier = GetScoreMod();
 }
 void GameOptions_ValueChanged(ScrollChoice choice, string oldValue, string newValue)
 {
     ScoreModifier = GetScoreMod();
 }
        void GameOptions_SelectChoice(ScrollChoice choice)
        {
            switch (choice.Name)
            {
            case "play":
                // Music
                string levelMusic;
                if (GetChoiceValue("music") == "Random")
                {
                    levelMusic = "level0" + Maths.RandomNr(1, 3).ToString();
                }
                else
                {
                    switch (GetChoiceValue("music"))
                    {
                    case "Techno1":
                        levelMusic = "level01";
                        break;

                    case "Airship":
                        levelMusic = "level02";
                        break;

                    case "Poss":
                        levelMusic = "level03";
                        break;

                    default:
                        throw new CaseStatementMissingException();
                    }
                }

                eDropRateMod dropRateMod = (eDropRateMod)Enum.Parse(typeof(eDropRateMod), GetChoiceValue("dropRate"));

                // Create level
                new Level(int.Parse(GetChoiceValue("startWave")), (int)dropRateMod, int.Parse(GetChoiceValue("waveDelay")) * 1000, GetChoiceByName("area").SelectedValueIdx + 1, ScoreModifier, levelMusic, (ePlaneType)GetChoiceByName("playerShip").SelectedValueIdx, GetChoiceByName("playerShip").SelectedValue);

                // set state
                Engine.Instance.ActiveState = Level.Instance;
                break;

            case "playerShip":
                // Do nothing
                break;

            case "startWave":
                // Do nothing
                break;

            case "area":
                // Do nothing
                break;

            case "waveDelay":
                // Do nothing
                break;

            case "music":
                // Do nothing
                break;

            case "back":
                Engine.Instance.ActiveState = new MainMenu(false);
                break;

            default:
                throw new CaseStatementMissingException();
            }
        }