protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue); // Draw background
spriteBatch.Begin();
for (int i = 0; i < bullets.Count; i++) // Draw bullets
{
bullets[i].Draw(spriteBatch);
}
for (int i = 0; i < platforms.Count; i++) // Draw platforms
{
platforms[i].Draw(spriteBatch);
}
for (int i = 0; i < enemies.Count; i++) // Draw enemies and their health bars
{
enemies[i].Draw(spriteBatch);
healthBars[i].Draw(spriteBatch, gun.Damage);
}
player.Draw(spriteBatch); // Draw player
glasses.Draw(spriteBatch); // Draw glasses
if (isTurnedLeft == true)
{
gun.DrawLeft(spriteBatch); // Draw left gun
}
else
{
gun.DrawRight(spriteBatch); // Draw right gun
}
spriteBatch.Draw(crosshairTex, new Vector2(mouseState.X - 10, mouseState.Y - 10), Color.White); // Draw crosshair
spriteBatch.End();
base.Draw(gameTime);
}