generated from mwc/project_drawing
First update: yellow circle orbitted by blue circle
Somewhere I got stuck was figuring out how to get the yellow circle centered. I fixed it by figuring out where the circle started and adjusting the starting place. The next thing I want to do is figure out how to get more planets rotating around the single point aka the sun.
This commit is contained in:
parent
1e7ed24a3a
commit
784ef6a1bd
Binary file not shown.
33
drawing.py
33
drawing.py
|
@ -5,3 +5,36 @@
|
|||
# (Briefly describe what this program does.)
|
||||
|
||||
from turtle import *
|
||||
from superturtle.animation import animate
|
||||
|
||||
|
||||
def fly(distance):
|
||||
penup()
|
||||
forward(distance)
|
||||
pendown()
|
||||
|
||||
|
||||
def sun():
|
||||
fillcolor("yellow")
|
||||
begin_fill()
|
||||
fly(20)
|
||||
left(90)
|
||||
circle(20)
|
||||
end_fill()
|
||||
left(90)
|
||||
fly(20)
|
||||
|
||||
|
||||
for frame in animate(60, loop=True):
|
||||
sun()
|
||||
with frame.rotate(0, 360):
|
||||
fly(100)
|
||||
fillcolor("blue")
|
||||
begin_fill()
|
||||
circle(20)
|
||||
end_fill()
|
||||
|
||||
done()
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue