Пример #1
0
        //private RotatingBarrel m_Barrel;

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            //spriteBatch = new SpriteBatch(GraphicsDevice);
            m_Scheduler          = new SceneScheduler();
            m_Scheduler.MainTune = Music.GetMenuTune();
            m_PlayingScene       = new PlayingScene();
            m_ChooseModeScene    = new ChooseModeScene(@"Backgrounds\ChooseMode");
            m_SelectPlayerScene  = new SelectPlayerScene(@"Backgrounds\JoinPlayers");
            m_SplashScreen       = new SplashScene(@"Backgrounds\Splash");
            m_WinScene           = new WinScene(@"Backgrounds\Score");
            m_CreditsScene       = new CreditsScene(@"Backgrounds\Credits");

            m_Scheduler.AddSceneChange(
                new SceneChange(m_SplashScreen, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
//            m_Scheduler.AddSceneChange(new SceneChange(m_SelectPlayerScene, m_ChooseModeScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            m_Scheduler.AddSceneChange(new SceneChange(m_SelectPlayerScene, m_PlayingScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            //m_Scheduler.AddSceneChange(new SceneChange(m_ChooseModeScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.B)));
            //m_Scheduler.AddSceneChange(new SceneChange(m_ChooseModeScene, m_PlayingScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
//            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_ChooseModeScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.B)));
//            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.B)));
            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_WinScene, gt => m_PlayingScene.GameOver()));
//            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_WinScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            //            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_ChooseModeScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_CreditsScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Y)));
            m_Scheduler.AddSceneChange(new SceneChange(m_CreditsScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));

            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Back)));
            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Back)));
            m_Scheduler.AddSceneChange(new SceneChange(m_CreditsScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Back)));

            Components.Add(m_CreditsScene);
            Components.Add(m_WinScene);
            Components.Add(m_SplashScreen);
            Components.Add(m_SelectPlayerScene);
            Components.Add(m_ChooseModeScene);
            Components.Add(m_PlayingScene);
            Components.Add(m_Scheduler);

            //Components.Add(m_Barrel);

            base.LoadContent();


            // TODO: use this.Content to load your game content here
        }