Get the position of the Turtle in Python
3 answers
I wanted to know if turtle1 and turtle2 were at the same coordinate i if turtle1.pos () == turtle2.pos ()
Yes, but since the turtle is playing on a floating point plane, this can cause you problems when they are close but not exactly on top of each other. You will probably be better off with a test like:
turtle1.distance(turtle2) < 0.1
those. this distance between centers is less than a certain factor that you define. If you want to know if parts of the turtle overlap (for example touching the feet) your fuzz factor can be as high as 10.0
0
source to share