public bool CollidesWith(CollisionMask other) { if (CheckBoundingBoxCollision(other)) { other.CalculateBoundingBox(); CalculateBoundingBox(); bool a = false; bool b = false; for (int y = top; y < bottom; y++) { for (int x = left; x < right; x++) { a = data.GetPixel(x - left, y - top); b = other.data.GetPixel(x - other.left, y - other.top); if (a && b) { return true; } } } } return false; }
public bool CheckBoundingBoxCollision(CollisionMask other) { return(rect.Intersects(other.GetBounds()) || rect.Contains(other.GetBounds())); }
public bool CheckBoundingBoxCollision(CollisionMask other) { return rect.Intersects(other.GetBounds()) || rect.Contains(other.GetBounds()); }