Home > other >  Consult about turtle dynamic implementation of python
Consult about turtle dynamic implementation of python

Time:09-28

Excuse me each people know how to achieve it, turtle drawing can't move a polygon as a whole, just as I now draw a square in the center of the screen, I now want to overall it moved to the upper right corner, rather than let the graphic disappears, and then draw a, in the upper right-hand corner to move to the top right corner the graphics whole move so there will be a smooth animation process, that is dynamic,

CodePudding user response:

Don't too can realize, think of way can redraw quickly

CodePudding user response:

S=turtle. Shape (" compound ")
Poly1=((0, 0), (100-5), (0, 30), and (5) - 100, -)
S.a ddcomponent (poly1, "red", "blue")
Poly2=((0, 0), (100-10), (- 100-10))
S.a ddcomponent (poly2, "blue", "red")
Turtle. Register_shape (" myshape ", s)

Time. Sleep (0.5)
Turtle. Penup ()
Turtle. Fd (100)

# amplification factor
Turtle. Shapesize (2, 2)
Turtle. Shape (" circle ")


Turtle. Shapesize (4, 4)
Turtle. Shape (" circle ")
Turtle. Shape (" myshape ")
Time. Sleep (0.5)
Turtle. Goto (100100)
Turtle. Shape (" circle ")
Time. Sleep (0.5)
Turtle. Shape (" myshape ")
Time. Sleep (0.5)
Turtle. Goto (200-200)
Turtle. Shape (" circle ")
Time. Sleep (0.5)
Turtle. Shape (" myshape ")
Time. Sleep (5)

Yes, with a definition

CodePudding user response:

For I in range (20200, 1) :
Turtle. Goto (I, I)
Turtle. Shape (" myshape ")



It is smooth
  • Related