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)
        {
            base.Draw(gameTime);
            GraphicsDevice.Clear(Color.CornflowerBlue);

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

            if (!gameOver)
            {
                floor.DrawMe(spriteBatch);
                dinosaur.DrawMe(spriteBatch);
                cactus.DrawMe(spriteBatch);
                cactus2.DrawMe(spriteBatch);
                bird.DrawMe(spriteBatch);
            }
            else
            {
                spriteBatch.DrawString(
                    gameOverText,
                    "GameOver",
                    new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2),
                    Color.Black);
            }

            //drawrect(_dinosaur);
            spriteBatch.End();
        }