I think you mean objects, not sprites.
I mean, you want to know how to measure the distance between two sprite objects that are the same type.
The objects need to be able to distinguish one from another, for this a variable called "nameObject" is used, one object is named as "A" and the other object as "B"
There is probably another method but right now I can't think of