|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import turtle
turtle.pensize(4)
turtle.hideturtle()
turtle.setup(1000, 600)
turtle.speed(10)
# 画鼻子
def nose(color):
turtle.penup()
turtle.seth(90)
turtle.fd(100)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor(color)
turtle.seth(45)
turtle.fd(25)
turtle.seth(135)
turtle.circle(25, 95)
turtle.seth(315)
turtle.fd(25)
turtle.end_fill()
# 画眼睛
def eyes():
turtle.penup()
turtle.seth(160)
turtle.fd(250)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor('black')
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.circle(50, 60)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor('white')
turtle.circle(20)
turtle.end_fill()
turtle.penup()
turtle.seth(-9.5)
turtle.fd(530)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor('black')
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.circle(50, 230)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor('white')
turtle.circle(20)
turtle.end_fill()
# 画脸
def face(size):
turtle.penup()
turtle.seth(195)
turtle.fd(600)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor('red')
turtle.circle(size)
turtle.end_fill()
turtle.penup()
turtle.seth(-11)
turtle.fd(720)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor('red')
turtle.circle(size)
turtle.end_fill()
# 画嘴巴
def mouth(emotion):
if emotion == "sad":
turtle.up()
turtle.goto(100,-100)
turtle.down()
turtle.setheading(90)
turtle.circle(100, 180)
if emotion == "happy":
turtle.penup()
turtle.goto(340, -150)
turtle.seth(135)
turtle.fd(250)
turtle.pendown()
turtle.seth(-300)
turtle.circle(30, -65)
turtle.begin_fill()
turtle.fillcolor('Firebrick')
turtle.seth(165)
turtle.fd(140)
turtle.seth(195)
turtle.fd(140)
turtle.seth(-360)
turtle.circle(30, -65)
turtle.penup()
turtle.seth(-60)
turtle.circle(30, 65)
turtle.pendown()
turtle.seth(-70)
turtle.fd(240)
turtle.circle(55, 140)
turtle.seth(70)
turtle.fd(240)
turtle.end_fill()
turtle.seth(-110)
turtle.fd(80)
turtle.begin_fill()
else:
pass
#肤色
def skincolour(color):
turtle.bgcolor(color)
#鼻子
nose("red")
#眼睛
eyes()
#脸颊
face(70)
#嘴巴
mouth("happy")
#皮肤
skincolour("yellow")
turtle.done()
|
评分
-
查看全部评分
|