Example #1
0
        protected bool IsCollision(Vertices a, Vertices b)
        {
            if (a.X1 <= b.X2 &&
                a.X2 >= b.X1 &&
                a.Y1 <= b.Y2 &&
                a.Y2 >= b.Y1)
                return true;

            return false;
        }
Example #2
0
 private void UpdateVertices()
 {
     Vertices = new Vertices
                {
                    X1 = Position.X,
                    X2 = Position.X + Width,
                    Y1 = Position.Y,
                    Y2 = Position.Y + Height
                };
 }