import turtle
t = turtle.Pen()
t.pensize(5)
t.speed(0)
t.hideturtle()
def head():
t.fillcolor("red")
t.begin_fill()
t.forward(50)
t.left(45)
t.forward(141)
t.left(45)
t.forward(180)
t.circle(150,180)
t.forward(180)
t.left(45)
t.forward(141)
t.left(45)
t.forward(50)
t.end_fill()
def face():
t.penup()
t.goto(0,40)
t.pendown()
turtle.colormode(255)
t.fillcolor(231,184,32)
t.begin_fill()
t.forward(30)
t.right(45)
t.fd(20)
t.left(80)
t.forward(60)
t.left(45)
t.forward(30)
t.right(45)
t.forward(40)
for i in range(65):
t.left(1)
t.forward(0.3)
t.forward(230)
t.left(50)
t.forward(50)
t.left(80)
t.forward(70)
t.right(45)
t.fd(40)
t.right(80)
t.fd(60)
t.left(105)
t.fd(60)
for i in range(30):
t.left(2)
t.forward(1.5)
t.fd(210)
for i in range(60):
t.left(1)
t.forward(0.3)
t.forward(40)
t.right(60)
t.fd(20)
t.left(45)
t.fd(50)
t.end_fill()
t.left(90)
t.fd(35)
t.right(45)
t.fd(30)
def eye():
t.setheading(35)
t.fillcolor("white")
t.pensize(3)
t.penup()
t.goto(-115,250)
t.pendown()
t.begin_fill()
t.right(40)
t.fd(75)
t.right(60)
t.fd(30)
t.right(120)
t.fd(50)
t.right(45)
t.fd(35)
t.end_fill()
t.right(135)
t.fd(65)
t.left(5)
t.fd(60)
t.left(10)
t.fd(90)
t.backward(80)
t.begin_fill()
t.right(90)
t.fd(30)
t.left(90)
t.fd(50)
t.left(45)
t.fd(40)
t.end_fill()
def mouth():
t.penup()
t.goto(-115,200)
t.pendown()
t.setheading(-45)
for i in range(40):
t.right(0.2)
t.fd(1.5)
t.penup()
t.goto(120,200)
t.pendown()
t.setheading(-135)
for i in range(40):
t.left(0.2)
t.fd(2)
t.penup()
t.goto(-75,65)
t.pendown()
t.setheading(45)
t.fd(50)
t.setheading(0)
t.fd(80)
t.setheading(-45)
t.fd(65)
def main():
head()
face()
eye()
mouth()
turtle.done()
if __name__ == "__main__":
main()
绘制钢铁侠
最新推荐文章于 2023-12-14 10:11:03 发布