import turtle as t
t.penup()
t.fd(-100)
t.pendown()#将画笔移到画布靠左的位置
t.speed(10)
t.pensize(3)
t.circle(60)
t.seth(-90)#将画笔转向下
t.fd(90)
t.seth(-135)
t.fd(90)
t.penup()
t.fd(-90)
t.pendown()
t.seth(-15)
t.fd(70)
t.seth(-115)
t.fd(70)
t.penup()
t.fd(-70)
t.seth(165)
t.fd(70)
t.seth(90)
t.fd(70)
t.pendown()
t.seth(360)
t.fd(80)
t.seth(45)
t.fd(40)
t.penup()
t.fd(-40)
t.seth(180)
t.fd(80)
t.seth(-90)
t.fd(20)
t.pendown()
t.seth(360)
t.fd(80)
t.seth(-45)
t.fd(40)
t.penup()
t.fd(-40)
t.seth(180)
t.fd(80)
t.seth(90)
t.fd(110)
t.seth(180)
t.fd(20)
t.pendown()
t.circle(2)
t.penup()
t.seth(0)
t.fd(40)
t.pendown()
t.circle(2)
t.penup()
t.seth(-20)
t.fd(190)
t.pendown()
t.begin_fill()#画爱心并填充背景颜色
t.pencolor('red')
t.fillcolor('red')
t.left(90)
t.circle(30,180)
t.circle(90,70)
t.left(38)
t.circle(90,70)
t.circle(30,180)
t.end_fill()
#t.pendown和t.penup是成对出现,主要是提起画笔和放下画笔,在这个过程中行进时不留下痕迹
#t.begin_fill和t.end_fill也是成对出现用于封闭图形色彩的填充
发射爱心
最新推荐文章于 2022-02-21 16:48:03 发布