import turtle turtle.speed(2) turtle.setup(900,1000,300,0) turtle.penup() turtle.goto(-260,200) turtle.pendown() turtle.pensize(2) turtle.pencolor("black") turtle.begin_fill() #脑门 turtle.colormode(255) turtle.fillcolor(79,119,170) turtle.seth(30) turtle.fd(150) turtle.rt(30) turtle.fd(400) turtle.seth(-150) turtle.fd(150) turtle.lt(150) turtle.backward(400) turtle.end_fill() turtle.begin_fill() #正脸 turtle.colormode(255) turtle.fillcolor(64,94,144) turtle.seth(-90) turtle.fd(390) turtle.lt(90) turtle.fd(400) turtle.lt(90) turtle.fd(390) turtle.end_fill() turtle.begin_fill() #右脸 turtle.colormode(255) turtle.fillcolor(36,50,89) turtle.seth(30) turtle.fd(150) turtle.rt(120) turtle.fd(390) turtle.rt(60) turtle.fd(150) turtle.lt(60) turtle.end_fill() turtle.begin_fill() #嘴+鼻子 turtle.colormode(255) turtle.fillcolor(240,240,240) turtle.penup() turtle.goto(-150,-30) turtle.pendown() turtle.circle(80,360) turtle.end_fill() turtle.penup() #鼻子 turtle.goto(-80,20) turtle.dot(60,"black") turtle.penup() turtle.goto(-125,-45) turtle.pendown() turtle.circle(50,185) turtle.lt(220) turtle.penup() turtle.goto(-125,-45) turtle.pendown() turtle.circle(20,40) turtle.circle(25,5) turtle.fd(70) turtle.circle(30,50) turtle.penup() #开始画腿 turtle.goto(-70,-190) turtle.pendown() turtle.begin_fill() #腿 turtle.colormode(255) turtle.fillcolor(44,50,76) turtle.rt(140) turtle.fd(80) turtle.lt(90) turtle.fd(100) turtle.lt(90) turtle.fd(80) turtle.end_fill() turtle.penup() turtle.goto(-210,-240) turtle.rt(180) turtle.pendown() turtle.circle(55) turtle.penup() turtle.goto(-160,-290) turtle.lt(180) turtle.pendown() turtle.circle(-50,90) turtle.penup() turtle.goto(-145,-260) turtle.lt(120) turtle.pendown() turtle.circle(50,60) turtle.penup() turtle.goto(-110,-310) turtle.rt(90) turtle.pendown() turtle.circle(-40,90) turtle.penup() #脚趾头 turtle.goto(-90,-330) turtle.lt(180) turtle.pendown() turtle.circle(-20,90) turtle.rt(45) turtle.circle(-50,45) turtle.penup() turtle.goto(-90,-330) turtle.pendown() turtle.lt(45) turtle.circle(-40,45) turtle.penup() turtle.goto(-90,-330) turtle.rt(30) turtle.pendown() turtle.circle(40,50) turtle.rt(20) turtle.fd(90) turtle.circle(31,190) turtle.penup() #开始画右手 turtle.goto(200,90) turtle.rt(150) turtle.pendown() turtle.fd(100) turtle.lt(60) turtle.circle(-20,30) turtle.fd(30) turtle.circle(-50,30) turtle.circle(-30,40) turtle.circle(-20,150) turtle.circle(20,30) turtle.fd(30) turtle.rt(180) turtle.fd(30) turtle.circle(-20,180) turtle.fd(50) turtle.rt(180) turtle.fd(40) turtle.circle(-20,180) turtle.fd(100) turtle.circle(-20,120) turtle.fd(30) for i in range(5): turtle.rt(5) turtle.fd(9) for i in range(5): turtle.rt(1.1) turtle.fd(3) turtle.penup() #眼睛 turtle.goto(-135,18) turtle.lt(115) turtle.begin_fill() turtle.colormode(255) turtle.fillcolor(228,233,88) turtle.pendown() turtle.circle(-40,270) turtle.circle(-30,30) turtle.end_fill() turtle.penup() #右眼 turtle.goto(-50,48) turtle.rt(130) turtle.pendown() turtle.begin_fill() turtle.colormode(255) turtle.fillcolor(228,233,86) turtle.circle(-40,270) turtle.circle(-30,30) turtle.circle(-27,10) turtle.end_fill() turtle.penup() #左眉毛 turtle.goto(-90,80) turtle.rt(10) turtle.pendown() turtle.begin_fill() #嘴+鼻子 turtle.colormode(255) turtle.fillcolor(0,0,0) turtle.fd(80) turtle.circle(-15,185) turtle.fd(90) turtle.circle(-10,170) turtle.fd(20) turtle.end_fill() turtle.penup() #右眉毛 turtle.goto(-70,100) turtle.rt(120) turtle.pendown() turtle.begin_fill() #嘴+鼻子 turtle.colormode(255) turtle.fillcolor(0,0,0) turtle.fd(70) turtle.circle(-15,185) turtle.fd(80) turtle.circle(-11,168) turtle.fd(30) turtle.end_fill() turtle.penup() #左胳膊 turtle.goto(-260,80) turtle.begin_fill() turtle.colormode(255) turtle.fillcolor(40,49,82) turtle.lt(135) turtle.pendown() turtle.circle(60,180) turtle.end_fill() turtle.begin_fill() #左拳 turtle.colormode(255) turtle.fillcolor(236,236,236) turtle.lt(60) turtle.lt(180) turtle.penup() turtle.goto(-275,-40) turtle.rt(120) turtle.pendown() turtle.circle(15,240) turtle.rt(165) turtle.circle(20,180) turtle.rt(15) turtle.fd(19) turtle.penup() turtle.goto(-260,-40) turtle.pendown() turtle.lt(210) turtle.end_fill() for i in range(100): turtle.lt(0.5) turtle.fd(0.5) turtle.lt(10) turtle.penup() turtle.goto(-125,-45) turtle.pendown() turtle.begin_fill() #嘴 turtle.colormode(255) turtle.fillcolor(84,47,55) turtle.circle(50,185) turtle.lt(150) turtle.circle(-19,67) turtle.fd(70) turtle.circle(-10,20) turtle.circle(-30,20) turtle.end_fill() turtle.penup() #左眼珠 turtle.goto(-137,57) turtle.dot(43,"black") turtle.penup() #右眼珠 turtle.goto(-15,60) turtle.dot(43,"black") turtle.penup() turtle.goto(-35,-5) turtle.rt(120) turtle.pensize(3) turtle.pendown() for i in range(10): turtle.rt(2) turtle.fd(10) turtle.penup() turtle.goto(-30,-30) turtle.pensize(3) turtle.lt(10) turtle.pendown() for i in range(10): turtle.rt(3) turtle.fd(10) turtle.penup() turtle.goto(-110,-10) turtle.rt(190) turtle.pendown() for i in range(9): turtle.lt(3) turtle.fd(10) turtle.penup() turtle.goto(-110,-30) turtle.pendown() for i in range(11): turtle.lt(3) turtle.fd(10) turtle.penup() turtle.goto(200,90) turtle.rt(168) turtle.begin_fill() #右胳膊 turtle.colormode(255) turtle.fillcolor(37,49,91) turtle.pensize(2) turtle.pendown() turtle.fd(100) turtle.rt(147) for i in range(5): turtle.lt(5) turtle.fd(9) for i in range(5): turtle.lt(1.1) turtle.fd(1.6) turtle.rt(70) turtle.fd(150) turtle.end_fill()
原文地址:https://www.cnblogs.com/zhtbb/p/9949299.html
时间: 2024-10-08 15:03:09