コード例 #1
0
ファイル: Game1.cs プロジェクト: CIS580/Aether2DSamples
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            SimpleDemo1  simple1  = new SimpleDemo1();
            SimpleDemo2  simple2  = new SimpleDemo2();
            SimpleDemo3  simple3  = new SimpleDemo3();
            SimpleDemo4  simple4  = new SimpleDemo4();
            SimpleDemo5  simple5  = new SimpleDemo5();
            SimpleDemo6  simple6  = new SimpleDemo6();
            SimpleDemo7  simple7  = new SimpleDemo7();
            SimpleDemo8  simple8  = new SimpleDemo8();
            SimpleDemo9  simple9  = new SimpleDemo9();
            SimpleDemo10 simple10 = new SimpleDemo10();

            AdvancedDemo1 advanced1 = new AdvancedDemo1();
            AdvancedDemo2 advanced2 = new AdvancedDemo2();
            AdvancedDemo3 advanced3 = new AdvancedDemo3();
            AdvancedDemo4 advanced4 = new AdvancedDemo4();
            AdvancedDemo5 advanced5 = new AdvancedDemo5();
            AdvancedDemo6 advanced6 = new AdvancedDemo6();

            GameDemo1 game1 = new GameDemo1();

            MenuScreen menuScreen = new MenuScreen("Samples");

            menuScreen.AddMenuItem("Simple Samples", EntryType.Separator, null);
            menuScreen.AddMenuItem(simple1.GetTitle(), EntryType.Screen, simple1);
            menuScreen.AddMenuItem(simple2.GetTitle(), EntryType.Screen, simple2);
            menuScreen.AddMenuItem(simple3.GetTitle(), EntryType.Screen, simple3);
            menuScreen.AddMenuItem(simple4.GetTitle(), EntryType.Screen, simple4);
            menuScreen.AddMenuItem(simple5.GetTitle(), EntryType.Screen, simple5);
            menuScreen.AddMenuItem(simple6.GetTitle(), EntryType.Screen, simple6);
            menuScreen.AddMenuItem(simple7.GetTitle(), EntryType.Screen, simple7);
            menuScreen.AddMenuItem(simple8.GetTitle(), EntryType.Screen, simple8);
            menuScreen.AddMenuItem(simple9.GetTitle(), EntryType.Screen, simple9);
            menuScreen.AddMenuItem(simple10.GetTitle(), EntryType.Screen, simple10);

            menuScreen.AddMenuItem("Advanced Samples", EntryType.Separator, null);
            menuScreen.AddMenuItem(advanced1.GetTitle(), EntryType.Screen, advanced1);
            menuScreen.AddMenuItem(advanced2.GetTitle(), EntryType.Screen, advanced2);
            menuScreen.AddMenuItem(advanced3.GetTitle(), EntryType.Screen, advanced3);
            menuScreen.AddMenuItem(advanced4.GetTitle(), EntryType.Screen, advanced4);
            menuScreen.AddMenuItem(advanced5.GetTitle(), EntryType.Screen, advanced5);
            menuScreen.AddMenuItem(advanced6.GetTitle(), EntryType.Screen, advanced6);

            menuScreen.AddMenuItem("Game Samples", EntryType.Separator, null);
            menuScreen.AddMenuItem(game1.GetTitle(), EntryType.Screen, game1);

            menuScreen.AddMenuItem("", EntryType.Separator, null);
            menuScreen.AddMenuItem("Exit", EntryType.ExitItem, null);

            ScreenManager.AddScreen(new BackgroundScreen());
            ScreenManager.AddScreen(menuScreen);
            ScreenManager.AddScreen(new LogoScreen(TimeSpan.FromSeconds(3.0)));
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: grzdrz/gms
        protected override void Initialize()
        {
            base.Initialize();

            GameLevel     simpleTest    = new GameLevel();
            GameLevel1    gameLevel1    = new GameLevel1();
            SimpleDemo1   simpleDemo1   = new SimpleDemo1();
            SimpleDemo2   simpleDemo2   = new SimpleDemo2();
            SimpleDemo3   simpleDemo3   = new SimpleDemo3();
            SimpleDemo4   simpleDemo4   = new SimpleDemo4();
            SimpleDemo5   simpleDemo5   = new SimpleDemo5();
            SimpleDemo6   simpleDemo6   = new SimpleDemo6();
            SimpleDemo7   simpleDemo7   = new SimpleDemo7();
            SimpleDemo8   simpleDemo8   = new SimpleDemo8();
            SimpleDemo9   simpleDemo9   = new SimpleDemo9();
            SimpleDemo10  simpleDemo10  = new SimpleDemo10();
            AdvancedDemo1 advancedDemo1 = new AdvancedDemo1();
            AdvancedDemo2 advancedDemo2 = new AdvancedDemo2();
            AdvancedDemo3 advancedDemo3 = new AdvancedDemo3();
            AdvancedDemo4 advancedDemo4 = new AdvancedDemo4();
            AdvancedDemo5 advancedDemo5 = new AdvancedDemo5();


            MenuScreen menuScreen = new MenuScreen("Samples");

            menuScreen.AddMenuItem(simpleTest.GetTitle(), EntryType.Screen, simpleTest, "1");
            menuScreen.AddMenuItem(gameLevel1.GetTitle(), EntryType.Screen, gameLevel1, "2");
            menuScreen.AddMenuItem(simpleDemo1.GetTitle(), EntryType.Screen, simpleDemo1, "3");
            menuScreen.AddMenuItem(simpleDemo2.GetTitle(), EntryType.Screen, simpleDemo2, "4");
            menuScreen.AddMenuItem(simpleDemo3.GetTitle(), EntryType.Screen, simpleDemo3, "5");
            menuScreen.AddMenuItem(simpleDemo4.GetTitle(), EntryType.Screen, simpleDemo4, "6");
            menuScreen.AddMenuItem(simpleDemo5.GetTitle(), EntryType.Screen, simpleDemo5, "7");
            menuScreen.AddMenuItem(simpleDemo6.GetTitle(), EntryType.Screen, simpleDemo6, "8");
            menuScreen.AddMenuItem(simpleDemo7.GetTitle(), EntryType.Screen, simpleDemo7, "9");
            menuScreen.AddMenuItem(simpleDemo8.GetTitle(), EntryType.Screen, simpleDemo8, "10");
            menuScreen.AddMenuItem(simpleDemo9.GetTitle(), EntryType.Screen, simpleDemo9, "11");
            menuScreen.AddMenuItem(simpleDemo10.GetTitle(), EntryType.Screen, simpleDemo10, "12");
            menuScreen.AddMenuItem(advancedDemo1.GetTitle(), EntryType.Screen, advancedDemo1, "13");
            menuScreen.AddMenuItem(advancedDemo2.GetTitle(), EntryType.Screen, advancedDemo2, "14");
            menuScreen.AddMenuItem(advancedDemo3.GetTitle(), EntryType.Screen, advancedDemo3, "15");
            menuScreen.AddMenuItem(advancedDemo4.GetTitle(), EntryType.Screen, advancedDemo4, "16");
            menuScreen.AddMenuItem(advancedDemo5.GetTitle(), EntryType.Screen, advancedDemo5, "17");


            menuScreen.AddMenuItem("", EntryType.Separator, null, "");
            menuScreen.AddMenuItem("Exit", EntryType.ExitItem, null, "");

            MainMenuScreen mainMenuScreen = new MainMenuScreen("MainMenu");

            mainMenuScreen.AddMenuItem(EntryType.Screen, menuScreen);
            mainMenuScreen.AddMenuItem(EntryType.ExitItem, null);

            ScreenManager.AddScreen(background = new BackgroundScreen());
            ScreenManager.AddScreen(mainMenuScreen);
            ScreenManager.AddScreen(new LogoScreen(TimeSpan.FromSeconds(3.0)));
        }