Exemplo n.º 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.CornflowerBlue);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            if (gamestate == 0)
            {
                background2.drawme(ref spriteBatch);
            }
            else
            {
                background.drawme(ref spriteBatch);
            }

            spriteBatch.End();

            // Draw stuff depending on the game state
            switch (gamestate)
            {
            case -1:
                // Game is on the main menu
                drawmenu();
                break;

            case 0:
                // Game is being played
                drawgame(gameTime);
                break;

            case 1:
                // Options menu
                drawoptions();
                break;

            case 2:
                // High Score table
                drawhighscore();
                break;

            default:
                break;
            }


            base.Draw(gameTime);
        }
Exemplo 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.CornflowerBlue);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            background.drawme(ref spriteBatch);
            spriteBatch.DrawString(mainfont, "Resolution " + displaywidth.ToString() + " " + displayheight.ToString(), new Vector2(20, 20), Color.Yellow);
            spriteBatch.End();

            // Draw stuff depending on the game state
            switch (gamestate)
            {
            case -1:
                // Game is on the main menu
                drawmenu();
                break;

            case 0:
                // Game is being played
                drawgame();
                break;

            case 1:
                // Options menu
                drawoptions();
                break;

            case 2:
                // High Score table
                drawhighscore();
                break;

            default:
                break;
            }


            base.Draw(gameTime);
        }