protected bool IsTouchingTop(CircleObject obj) { return(this.Rectangle.Bottom + this.Direction.Y > obj.Circle.Top && this.Rectangle.Top < obj.Circle.Top && this.Rectangle.Right > obj.Circle.Left && this.Rectangle.Left < obj.Circle.Right); }
protected bool IsTouchingRight(CircleObject obj) { return(this.Rectangle.Left + this.Direction.X < obj.Circle.Right && this.Rectangle.Right > obj.Circle.Right && this.Rectangle.Bottom > obj.Circle.Top && this.Rectangle.Top < obj.Circle.Bottom); }
public bool IsTouching(CircleObject obj) { if (this.IsTouchingTop(obj) || this.IsTouchingBottom(obj) || this.IsTouchingLeft(obj) || this.IsTouchingRight(obj)) { return(true); } return(false); }