protected override void LoadContent()
{
Sprite = Game.Content.Load<Texture2D>(@"Graphics/Entities/enemy");
_healthBar = Game.Content.Load<Texture2D>(@"Graphics/Pictures/pixel");
Center = new Vector2(Sprite.Width / 2f, Sprite.Height / 2f);
// Audio
if (_deadSound == null)
_deadSound = Game.Content.Load<SoundEffect>(@"Audio/SE/boss_dead");
List<Point> vertices = new List<Point>()
{
new Point(0, (int)(Sprite.Height / 2.74f)),
new Point(Sprite.Width / 2, 0),
new Point(Sprite.Width, (int)(Sprite.Height / 2.74f)),
new Point(Sprite.Width / 2, Sprite.Height)
};
CollisionBox = new CollisionConvexPolygon(this, Vector2.Zero, vertices);
Position = new Vector2(
Config.GameArea.X / 2f,
Config.GameArea.Y / 2f);
//Get all the xml files
foreach (var source in Directory.GetFiles(@"Content\XML", "*.xml", SearchOption.AllDirectories))
{
//store the name
_patternNames.Add(source);
//load the pattern
BulletPattern pattern = new BulletPattern();
pattern.ParseXML(source);
_myPatterns.Add(pattern);
}
_currentPattern = GameplayScreen.Rand.Next(0, _patternNames.Count);
AddBullet(true);
base.LoadContent();
}