Can someone please tell me how to disable .onkey() in python turtle? I have to make in a way so that once one of the turtles hits the other, the second turtle dies. Every time the first turtle hits the second, the player can still move around. I want to know how to stop that from happening. Please help me.
gimme the repl
[EDIT]: I found the repl
Instead of "disabling" the onkey, you can set a flag that will make the attached function stop before it moves anything. Kinda like this:
def moveme(): if (iAmDead): return turt.left(69) scene.onkey(moveme, "Left")
Then you can set
iAmDead to True to prevent the turtle from moving.