public bool HasTouchedPlayer(BossLib bossLib) { if (new System.Drawing.Rectangle((int)position.X, (int)position.Y, Texture.Width, Texture.Height).IntersectsWith(Player.CurrentPlayer.PlayerLib.Bounds)) { bossLib.MakeDamage(Player.CurrentPlayer.PlayerLib); Player.CurrentPlayer.PlayerInfo.Life -= 20; return(true); } return(false); }
private void CheckKeyboardAndUpdateMovement() { if (BossLib.Vision.IntersectsWith(PlayerLib.Bounds)) { if (BossLib.Bounds.IntersectsWith(PlayerLib.Bounds)) { _player.PlayerInfo.Life -= 25; BossLib.MakeDamage(PlayerLib); } if (BossLib.GetDistanceTo(PlayerLib.Position).X < 0.1 && BossLib.State != 2) { BossLib.Left(); } else { BossLib.LeftSlim(); } } else { if (BossLib.State != 2) { BossLib.Right(); } else { BossLib.RightSlim(); } } if (_count <= 50) { _count++; } else { _count = 0; if (BossLib.State == 1) { BossLib.Life -= 10; } } }