You could use this function that I'm using in a game I wrote
VB Code:
'' What is the distance between two given set of co-ordinates ? Private Function DistanceBetweenTwoPoints(point1 As CoOrd_type, point2 As CoOrd_type) As Single DistanceBetweenTwoPoints = (((point2.X - point1.X) ^ 2) + ((point2.Y - point1.Y) ^ 2)) ^ 0.5 End Function
CoOrd_type is a UDT that just as a .x and a .y member




Reply With Quote