Пример #1
0
        public void HandleTitleScreen(object theObject, EventArgs e)
        {
            switch (mTitle.mMenu.SelectedItem.Text)
            {
                case "Exit Game":
                    {
                        this.Exit();
                        break;
                    }

                case "1 Player":
                    {
                        mGameplay.StartOnePlayerGame(PlayerIndex.One);
                        mCurrentScreen = mGameplay;
                        break;
                    }

                case "2 Player":
                    {
                        mGameplay.StartTwoPlayerGame(PlayerIndex.One, PlayerIndex.Two);
                        mCurrentScreen = mGameplay;
                        break;
                    }
            }
        }
Пример #2
0
        /// <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);

            Viewport aViewport = new Viewport();
            aViewport.X = 0;
            aViewport.Y = 0;
            aViewport.Width = 1280;
            aViewport.Height = 720;

            // TODO: use this.Content to load your game content here
            mGameplay = new Gameplay(Content, aViewport, new EventHandler(HandleGameplayScreen), PlayerIndex.One, PlayerIndex.Two);
            mTitle = new Title(Content, aViewport, new EventHandler(HandleTitleScreen));

            mCurrentScreen = mTitle;
        }