private void Attack (Player player) { if ((this._position.X - player._position.X) < 100 && (this._position.X - player._position.X) > 0 && player.IsAlive) { // this.Velocity = Vector2.Zero; this.isAttacking = true; player.Health = player.Health - 34; player.CheckHealth(); } else if ((this._position.X - player._position.X) < 100 && (this._position.X - player._position.X) > 0 && player.IsAlive) { } }
private void Attack(Player player, Dictionary <string, SoundEffect> soundEffects) { if ((this._position.X - player._position.X > -100) && (this._position.X - player._position.X < 1) && !(this.Position.Y > player.Position.Y)) { this.isAttacking = true; player.Health = player.Health - 34; soundEffects["Death"].Play(); player.CheckHealth(); } else { isAttacking = false; } }