Esempio 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.Navy);

            spriteBatch.Begin();

            //Get current state and execute said states draw method
            switch (GameElements.currentState)
            {
            case GameElements.State.Run:
                GameElements.RunDraw(spriteBatch);
                break;

            case GameElements.State.Highscore:
                GameElements.HighScoreDraw(spriteBatch, Window);
                break;

            case GameElements.State.NewHighscore:
                GameElements.NewHighScoreDraw(spriteBatch);
                break;

            case GameElements.State.Quit:
                this.Exit();
                break;

            default:                     //By default, draw menu (game start)
                GameElements.MenuDraw(spriteBatch);
                break;
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Esempio n. 2
0
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.DarkBlue);
            GraphicsDevice.Clear(Color.DarkGreen);

            // TODO: Add your drawing code here
            spriteBatch.Begin();

            switch (GameElements.currentState)
            {
            case GameElements.State.Run: GameElements.RunDraw(spriteBatch);
                break;

            case GameElements.State.Highscore: GameElements.HighScoreDraw(spriteBatch);
                break;

            case GameElements.State.Quit:
                this.Exit();
                break;

            default: GameElements.MenuDraw(spriteBatch);
                break;
            }


            spriteBatch.End();


            base.Draw(gameTime);
        }
Esempio n. 3
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)
        {
            // TODO: Add your drawing code here
            spriteBatch.Begin();
            switch (GameElements.currentState)
            {
            case GameElements.state.Run:
                GameElements.RunDraw(spriteBatch);
                break;

            case GameElements.state.EnterHighScore:
                GameElements.EnterDraw(spriteBatch, myFont);
                break;

            case GameElements.state.PrintHighScore:
                GameElements.PrintDraw(spriteBatch, myFont);
                break;

            case GameElements.state.Quit:
                this.Exit();
                break;

            default:
                GameElements.MenuDraw(spriteBatch);
                break;
            }
            spriteBatch.End();
            base.Draw(gameTime);
        }