绘制皮卡丘
import turtleturtle.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()
牛X,刚才执行了一下你的程序,RUN后震惊了!!!!原来这就是Python!!!!! 坐标点是怎么确定的
https://www.jianshu.com/p/cbbcf4bdbd79
盗版! 至于吗?把别人的作品搬来说明原创,还不用代码格式?!
过分了吧!
https://www.jianshu.com/p/cbbcf4bdbd79
页:
[1]