The Distance Formula is very useful in game designing! This will hopefully teach you it! You can use this BTW without credit! The coordinates in the middle of the arrow is the mid point of the two shapes!