Ejemplo n.º 1
0
        protected override void Draw(GameTime gameTime)
        {
            // TODO: Add your drawing code here
            if (gameMode == GameMode.Menu)
            {
                GraphicsDevice.Clear(Color.White);
                gameMenu.Draw(_spriteBatch);
            }
            else if (gameMode == GameMode.HighScores)
            {
                GraphicsDevice.Clear(Color.White);
                highscores.Draw(_spriteBatch);
            }
            else if (gameMode == GameMode.CustomizeControls)
            {
                GraphicsDevice.Clear(Color.White);
                _spriteBatch.Begin();
                userControls.Draw(_spriteBatch);
                _spriteBatch.End();
            }
            else if (gameMode == GameMode.Game)
            {
                GraphicsDevice.Clear(Color.Black);
                //gameLogic.Draw(_spriteBatch);
                gameLogic.Draw(_spriteBatch);
            }

            base.Draw(gameTime);
        }
Ejemplo n.º 2
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.Black);
     // TODO: Add your drawing code here
     GraphicsDevice.Clear(Color.Black);
     // TODO: Add your drawing code here
     spriteBatch.Begin();
     //draw the start menu
     if (gameState == GameState.StartMenu && screenNumber == 0)
     {
         spriteBatch.Draw(backgroundImage, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0);
         start.Draw(spriteBatch);
     }
     //draw the number of players and game mode selection screen
     else if (gameState == GameState.StartMenu && screenNumber == 1)
     {
         spriteBatch.Draw(backgroundImage, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0);
         setup.Draw(spriteBatch);
     }
     else if (gameState == GameState.StartMenu && screenNumber == 2)
     {
         spriteBatch.Draw(backgroundImage, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0);
         playerSetup.Update(gameTime);
         playerSetup.Draw(spriteBatch);
     }
     else if (gameState == GameState.Playing && screenNumber == 3)
     {
         gameUI.Draw(spriteBatch);
         scoreBoards.DrawBoards(spriteBatch);
     }
     else if (gameState == GameState.Paused)
     {
     }
     else if (gameState == GameState.HighScore)
     {
         if (!EndGameSetup) //I'm not fond of this code. - Mark
         {
             scoreManager.SortLogic();
             highScoreScreen = new HighScores(scoreManager.getSprites(), BoardWidth, BoardHeight, 0, 0);
             highScoreScreen.Initialize(this);
             EndGameSetup = true;
         }
         else
         {
             spriteBatch.Draw(backgroundImage, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0);
             highScoreScreen.Draw(spriteBatch);
         }
     }
     spriteBatch.End();
     //base.Draw(gameTime);
 }