how to rotate turtle shape in python

Greg Peckory picture Greg Peckory · Jun 30, 2012 · Viewed 10.7k times · Source

I registered the shape of my turtle in my roulette game to a roulette wheel. I want the wheel to spin 3 times. This is my program:

register_shape("wheel.gif")
wheel = None
wheel = turtle.Turtle()
wheel.ht()
wheel.shape("wheel.gif")


wheel.shapesize(5, 5)
wheel.pu()
wheel.ht()
wheel.goto(-200,-200)
wheel.st()
r = 1
for r in range(108):
    wheel.right(10)

The wheel shows up properly but it doesn't seem to spin. I would assume this should work. If not is there any other way. Thank you.

Answer

Jere_JBC picture Jere_JBC · Feb 9, 2018

I had the same issue with Python turtle graphics. I circumvented it by registering different images in different rotational states. Then you can use conditional statements to show a suitable image in each partcular state. Hope it helps!