Example #1
0
 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);
 }
Example #2
0
 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);
 }
Example #3
0
        public bool IsTouching(CircleObject obj)
        {
            if (this.IsTouchingTop(obj) ||
                this.IsTouchingBottom(obj) ||
                this.IsTouchingLeft(obj) ||
                this.IsTouchingRight(obj))
            {
                return(true);
            }

            return(false);
        }