import turtle
t = turtle.Turtle()
t.penup()
t.goto(-200,297)
t.speed(400)
t.pensize(3)
t.pencolor("black")
#背景框
t.begin_fill()
t.fillcolor("lightpink")
t.penup()
t.goto(-200,-83)
t.seth(0)
t.pendown()
t.forward(380)
t.seth(90)
t.forward(380)
t.seth(180)
t.forward(380)
t.seth(270)
t.forward(380)
t.end_fill()
t.penup()
#turtle.screensize(800,600,"lightpink")
#t.pendown()
#头部
#t.pencolor("black")
#t.pensize(3)
t.penup()
t.goto(-65,170)
t.seth(70)
t.pendown()
t.forward(70)
t.seth(10)
t.circle(-120,35)
t.seth(-90)
t.forward(100)
#右腮帮
t.penup()
t.goto(65,100)
t.pendown()
t.circle(-25,360)
#右手
t.penup()
t.goto(52,75)
t.seth(-60)
t.pendown()
t.circle(-300,25)
t.seth(130)
t.forward(110)
#身体
t.penup()
t.goto(63,-20)
t.seth(200)
t.pendown()
t.circle(-300,34)
t.seth(85)
t.circle(-300,20)
#左腮帮
t.penup()
t.goto(-100,110)
t.pendown()
t.circle(-26,360)
#左手
t.penup()
t.goto(-88,77)
t.seth(-120)
t.pendown()
t.circle(350,24)
t.seth(60)
t.circle(350,8)
#眉毛
t.penup()
t.goto(-60,200)
t.seth(15)
t.pensize(8)
t.pencolor("black")
t.pendown()
t.forward(14)
t.penup()
t.goto(0,200)
t.seth(-25)
t.pendown()
t.forward(15)
#嘴巴
t.penup()
t.goto(-40,85)
t.seth(-15)
t.pensize(2)
t.pencolor("black")
t.pendown()
t.circle(15,80)
t.seth(25)
t.circle(-15,55)
t.penup()
t.goto(-35,78)
t.pendown()
t.circle(15,80)
#肚脐
t.penup()
t.goto(-50,-18)
t.seth(35)
t.pendown()
t.circle(-30,85)
t.penup()
t.goto(-30,-23)
t.pensize(6)
t.pendown()
t.forward(1)
#帽子
t.penup()
t.goto(-42,235)
t.seth(70)
t.pensize(2)
t.pendown()
t.begin_fill()
t.fillcolor("#000080")
t.forward(15)
t.seth(25)
t.circle(-75,53)
t.seth(-85)
t.forward(20)
t.seth(160)
t.circle(125,37)
t.penup()
t.goto(-39,250)
t.seth(145)
t.pendown()
t.forward(5)
t.circle(-25,180)
t.forward(25)
t.seth(-5)
t.forward(20)
t.circle(-20,180)
t.end_fill()
#红飘带
t.penup()
t.goto(45,260)
t.seth(-75)
t.begin_fill()
t.fillcolor("red")
t.pendown()
t.forward(40)
t.seth(145)
t.forward(10)
t.seth(-135)
t.forward(10)
t.seth(85)
t.forward(35)
t.end_fill()
#裤子
t.penup()
t.goto(-110,-33)
t.seth(-88)
t.begin_fill()
t.fillcolor("#00EE00")
t.pendown()
t.forward(50)
t.seth(0)
t.forward(80)
t.seth(65)
t.forward(15)
t.seth(-65)
t.forward(15)
t.seth(0)
t.forward(80)
t.seth(90)
t.forward(60)
t.goto(63,-20)
t.seth(200)
t.circle(-300,34)
t.end_fill()
t.penup()
#裤子上的紫色花纹
t.goto(-109,-60)
t.seth(-45)
t.begin_fill()
t.fillcolor("purple")
t.pendown()
t.circle(25,160)
t.seth(175)
t.forward(41)
t.end_fill()
t.penup()
t.goto(-12,-82)
t.seth(90)
t.begin_fill()
t.fillcolor("purple")
t.pendown()
t.circle(-25,180)
t.end_fill()
#左眼睛
t.penup()
t.goto(-50,100)
t.pendown()
t.begin_fill()
t.fillcolor("white")
t.setheading(0)
for i in range(2): #2*10*9*2=360
for j in range(10):
t.forward(j)
t.left(9)
for j in range(10,0,-1):
t.forward(j)
t.left(9)
t.end_fill()
#右眼睛
t.penup()
t.goto(-5,100)
t.begin_fill()
t.fillcolor("white")
t.pendown()
t.setheading(0)
for i in range(2): #2*5*18*2=360
for j in range(10):
t.forward(j)
t.left(9)
for j in range(10,0,-1):
t.forward(j)
t.left(9)
t.end_fill()
t.penup()
#黑眼球
t.goto(-45,130)
t.begin_fill()
t.fillcolor("black")
t.pendown()
t.setheading(0)
for i in range(2): #2*10*9*2=360
for j in range(5):
t.forward(j)
t.left(18)
for j in range(5,0,-1):
t.forward(j)
t.left(18)
t.end_fill()
t.penup()
python turtle 画 派大星
最新推荐文章于 2023-12-10 22:15:10 发布