Пример #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.BurlyWood);
            spriteBatch.Begin();
            spriteBatch.Draw(tekstury["background"], new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height), Color.White);
            spriteBatch.End();

            // TODO: Add your drawing code here
            if (GameState.IsShowMainMenuScene)
            {
                menuScene.Draw(spriteBatch, gameTime);
            }
            if (GameState.IsShowGameScene)
            {
                gameScene.Draw(spriteBatch, gameTime);
            }
            if (GameState.IsRankingScene)
            {
                rankingScene.Draw(spriteBatch, gameTime);
            }
            if (GameState.IsPlayerNameScene)
            {
                playerNameScene.Draw(spriteBatch, gameTime);
            }
            base.Draw(gameTime);
        }
Пример #2
0
        /// <summary>
        /// Main draw loop of the game
        /// </summary>
        /// <param name="gameTime"></param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);
            _spriteBatch.Begin();
            switch (_gameState)
            {
            case GameState.MainMenu:
                Menu.Draw(gameTime, _spriteBatch);
                break;

            case GameState.LoggedIn:
                CharacterSelect.Draw(gameTime, _spriteBatch);
                break;

            case GameState.RegisterAccount:
                RegisterAccount.Draw(gameTime, _spriteBatch);
                break;

            case GameState.CreateCharacter:
                CharacterCreate.Draw(gameTime, _spriteBatch);
                break;

            case GameState.Playing:
                GameScence.Draw(gameTime, _spriteBatch);
                break;
            }
            _spriteBatch.End();

            base.Draw(gameTime);
        }
Пример #3
0
        internal override void Draw(SpriteBatch spriteBatch)
        {
            switch (Data.currentState)
            {
            case Data.GameStates.Menu:
                ms.Draw(spriteBatch);
                break;

            case Data.GameStates.Game:
                break;

            case Data.GameStates.Settings:
                break;
            }
        }
Пример #4
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            if (Menu.IsShowMainMenuScene)
            {
                menuScene.Draw(spriteBatch, gameTime);
            }
            if (Menu.IsShowGameScene)
            {
                gameScene.Draw(spriteBatch, gameTime);
            }

            base.Draw(gameTime);
        }