public bool hitTest(Entity other) { bool returnValue = false; returnValue |= !(position.X > other.position.X + other.dimensions.X || position.X + dimensions.X <other.position.X || position.Y> other.position.Y + other.dimensions.Y || position.Y + dimensions.Y < other.position.Y); if (HasSecondaryHitBoxes) { for (int j = 0; j < secondaryHitBoxes.Length; j++) { returnValue |= SecondaryHitBox.hitTestBoxEntity(secondaryHitBoxes[j], other); } } if (other.HasSecondaryHitBoxes) { for (int i = 0; i < other.SecondaryHitBoxes.Length; i++) { returnValue |= SecondaryHitBox.hitTestBoxEntity(other.SecondaryHitBoxes[i], this); if (HasSecondaryHitBoxes) { for (int j = 0; j < secondaryHitBoxes.Length; j++) { returnValue |= SecondaryHitBox.hitTestBoxWithBox(secondaryHitBoxes[j], other.SecondaryHitBoxes[i]); } } } } return(returnValue); }