Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to rotate turtle shape in python

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.

like image 699
Greg Peckory Avatar asked Oct 07 '22 08:10

Greg Peckory


1 Answers

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!

like image 67
Jere_JBC Avatar answered Oct 12 '22 12:10

Jere_JBC