Beispiel #1
0
        public void Enter()
        {
            foreach (SimpleText text in menuEntries)
            {
                text.LeaveScreen();
            }
            title.LeaveScreen();
            foreach (SimpleText text in menuEntries)
            {
                if (text is ColoredText)
                {
                    switch (text.Name)
                    {
                    case "GameSP":
                        GameSP GameSP = new GameSP(Game, this);
                        Game.Components.Add(GameSP);
                        threadSP.Start();
                        break;

                    case "GameMP":
                        GameMP GameMP = new GameMP(Game, this);
                        Game.Components.Add(GameMP);
                        threadMP.Start();
                        break;

                    case "HowToPlay":
                        HowToPlay howToPlay = new HowToPlay(Game, this);
                        Game.Components.Add(howToPlay);
                        break;

                    case "About":
                        About credits = new About(Game, this);
                        Game.Components.Add(credits);
                        break;

                    case "Back":
                        MenuScreen back = new MenuScreen(Game, previousMenuScreen);
                        Game.Components.Add(back);
                        Text.LeaveScreen();
                        threadMP.Abort();
                        threadSP.Abort();
                        break;

                    case "Exit":
                        Game.Exit();
                        break;
                    }
                }
            }
        }