Example #1
0
        public bool CollidesWhenThisMoves(ThingComp other, Vector2 myPotentialMove)
        {
            Rectangle rectNow   = BoundingRectangle;
            Rectangle rectMoved = new Rectangle(rectNow.X + (int)Math.Round(myPotentialMove.X),
                                                rectNow.Y + (int)Math.Round(myPotentialMove.Y),
                                                rectNow.Width, rectNow.Height);

            return(IntersectPixels(rectMoved, textureData, other.BoundingRectangle, other.textureData));
        }
Example #2
0
        public bool CollidesWhenOtherMoves(ThingComp other, Vector2 othersPotentialMove)
        {
            Rectangle rectOther = other.BoundingRectangle;
            Rectangle rectMoved = new Rectangle(rectOther.X + (int)Math.Round(othersPotentialMove.X),
                                                rectOther.Y + (int)Math.Round(othersPotentialMove.Y),
                                                rectOther.Width, rectOther.Height);

            return(IntersectPixels(BoundingRectangle, textureData, rectMoved, other.textureData));
        }
Example #3
0
 public bool Collides(ThingComp other)
 {
     return(IntersectPixels(BoundingRectangle, textureData, other.BoundingRectangle, other.textureData));
 }