protected override void Draw(GameTime gameTime) { { GraphicsDevice.Clear(isAlive() ? (isPause ? Color.Blue : (isHit ? Color.Firebrick : Color.MediumSpringGreen)) : Color.Purple); person.Draw(spriteBatch); foreach (PixelCollision obstacle in obstacles) { obstacle.Draw(spriteBatch); } DrawLifeBar(spriteBatch); DrawScoreReport(spriteBatch); base.Draw(gameTime); } }
/// <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) { if (hit) { GraphicsDevice.Clear(Color.Red); } else { GraphicsDevice.Clear(Color.CornflowerBlue); } // TODO: Add your drawing code here spriteBatch.Begin(); person.Draw(spriteBatch); triangle.Draw(spriteBatch); spriteBatch.End(); base.Draw(gameTime); }