Reputation:
I am supposed to write a program that makes a turtle follow another one. All I need is a function that turns the following turtle towards the one running away.
Upvotes: 0
Views: 436
Reputation: 41872
It's not a function but a pair of functions:
chase_turtle.setheading(chase_turtle.towards(flee_turtle))
.towards()
gets the angle to the other turtle and .setheading()
aligns your turtle to it.
Make sure to keep the documentation at the ready when you program with turtles.
Upvotes: 1