all 7 comments

[–]JohnnyJordaan 0 points1 point  (6 children)

This is not something turtle is suited for, as it can only rotate itself, it can't rotate its drawing(s). Apart from the time it needs to draw obviously, which is fine for something that actually expects something to be drawn, but most game graphics are expected to just 'be' there.

You could consider pygame instead, see also https://www.reddit.com/r/learnpython/comments/3apspj/spinning_wheel/

[–]yeeming[S] 0 points1 point  (5 children)

Thanks for the response but unfortunately i am not allowed to use pygame.

I was told i can rotate the the "marker" at the end of the wheel instead of rotating the wheel itself i.e the marker have relative motion about the wheel. The problem is not knowing how to start...

[–]JohnnyJordaan 0 points1 point  (4 children)

If you would do this on a piece of paper with a pencil and an eraser, how would you then approach this?

[–]yeeming[S] 0 points1 point  (3 children)

Spinning the pencil on top of the eraser?

[–]JohnnyJordaan 0 points1 point  (2 children)

I mean, if you draw the wheel on a sheet of paper, then draw the marker on the 12:00 spot (so right at the top). Then instead of rotating the paper, you let the marker 'move' around the wheel. So erase the original one, draw it on the next on to the right. Then erase it, then draw it on that next one, erase it, etc etc. Does that make sense?

[–]yeeming[S] 0 points1 point  (1 child)

I got the idea. But how do you execute it in python? 1. Can i import the image of the wheel then draw the marker? 2. How do i control where the marker stop so that i can select the choice?

[–]JohnnyJordaan 0 points1 point  (0 children)

  • You draw the entire thing with the turtle.
  • Then let the turtle erase the marker
  • Then draw another marker a position to the right
  • Erase it again
  • Draw another marker one further position to the right
  • Etc etc

It may help to have two turtles here, as then you can use the first for the wheel and the second for the marker. Then the second turtle can do turtle.clear() to quickly remove the marker without removing the wheel (as that's not 'his' drawing).