private void Bee_OnDeath(BeeEntity bee) { this.PlayerManager.Player.DeathCount++; this.GamePlayOver(); }
/// <summary> /// Creates a new bird factory used to create bird entities. /// </summary> /// <param name="manager"></param> public BirdFactory(ContentManager manager, Action<BulletEntity> bulletFired, BeeEntity bee) { this.ContentManager = manager; this.BulletFired = bulletFired; this.Bee = bee; }
public override void Activate() { base.Activate(); this.ContentManager = new ContentManager(this.ScreenManager.Game.Content.ServiceProvider); this.ContentManager.RootDirectory = "content"; this.PlayerManager = new PlayerManager(); this.PlayerManager.Activate(this.ScreenManager.Game); var lBeeMovement = new MouseMovementBehavior(this.ScreenManager.InputState) { Velocity = Vector2.UnitX * (200 + (50 * this.PlayerManager.Player.BeeSpeed)), }; var lBee = new BeeEntity { MovementBehavior = lBeeMovement, ShootingBehavior = GetBeeShootingBehavior(), MaximumHealth = 5 + (this.PlayerManager.Player.BeeMaxHealth * 5), CurrentHealth = 5 + (this.PlayerManager.Player.BeeMaxHealth * 5), HealthRegen = this.PlayerManager.Player.BeeHeathRegen, }; lBee.OnDeath += this.Bee_OnDeath; System.Diagnostics.Debug.WriteLine("Bee Stats"); System.Diagnostics.Debug.WriteLine("-----------------------"); System.Diagnostics.Debug.WriteLine(string.Format("Movement Speed : {0}", lBee.MovementBehavior.Velocity)); System.Diagnostics.Debug.WriteLine(string.Format("Attack Speed : {0}", lBee.ShootingBehavior.FireRate)); System.Diagnostics.Debug.WriteLine(string.Format("Damage : {0}", lBee.ShootingBehavior.BulletDamage)); System.Diagnostics.Debug.WriteLine(string.Format("Bullet Count : {0}", this.PlayerManager.Player.BeeShotCount)); System.Diagnostics.Debug.WriteLine(string.Format("Bullet Speed : {0}", lBee.ShootingBehavior.BulletSpeed)); System.Diagnostics.Debug.WriteLine(string.Format("Attraction : {0}", this.PlayerManager.Player.BeeHoneycombAttraction)); System.Diagnostics.Debug.WriteLine(string.Format("Health : {0}", lBee.MaximumHealth)); System.Diagnostics.Debug.WriteLine(string.Format("Health Regen : {0}", lBee.HealthRegen)); System.Diagnostics.Debug.WriteLine(string.Empty); this.BeeManager = new BeeManager() { Bee = lBee }; this.LevelManager = new LevelManager(this.LevelIndex); this.LevelManager.LevelOver += this.LevelManager_LevelOver; this.LevelManager.ReleaseBird += this.LevelManager_ReleaseBird; this.LevelManager.Bee = this.BeeManager.Bee; this.LevelManager.BulletFired = this.BulletManager.Add; this.HeadsUpDisplay.GraphicsDevice = this.ScreenManager.GraphicsDevice; this.HeadsUpDisplay.HealthPercentage = 1; this.HeadsUpDisplay.HealthBarSize = new Vector2(12 * this.BeeManager.Bee.MaximumHealth, 25); this.CoinManager.Activate(this.ScreenManager.Game); this.BulletManager.Activate(this.ScreenManager.Game); this.BirdManager.Activate(this.ScreenManager.Game); this.BeeManager.Activate(this.ScreenManager.Game); this.CloudManager.Activate(this.ScreenManager.Game); this.LevelManager.Activate(this.ScreenManager.Game); this.HeadsUpDisplay.Activate(); }