Ejemplo 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);

            spriteBatch.Begin(SpriteSortMode.Texture,
                              null, null, null, null, null,
                              Camera2D.CameraTranslationMatrix);

            background.Draw(spriteBatch);
            level.Draw(spriteBatch);
            player.Draw(spriteBatch);

            playerScore.Draw(spriteBatch);
            playerHiScore.Draw(spriteBatch);

            for (int i = 0; i < player.SpeedBoosts; i++)//draw speed boosts
            {
                spriteBatch.Draw(spBoostSprite, new Vector2(50 * (i + 1), 675) + Camera2D.CameraPosition - cameraOffset, null, Color.White, 0.0f, new Vector2(0, 0), 1.0f, SpriteEffects.None, 0.0f);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }