python turtle画猫猫虫

本文介绍了如何使用Python的Turtle库进行编程,创造出一个由手、耳朵、身体和脸组成的人体图形,展示基础图形绘制技巧。

from turtle import *
bgcolor("black")
colormode(255)
speed(99)
def gtt(m,n):
    pu()
    goto(m,n)
    pd()

pencolor(253,250,137)
pensize(10)
gtt(-20,0)
for i in range (20):
    fd(800)
    bk(800)
    seth(i*20)

pensize(10) 
pencolor(60,60,60)
fillcolor(88,201,231)   
#手,右1
gtt(50,0)
begin_fill()
seth(90)
fd(90)
rt(45)
fd(80)
circle(40,40)
fd(40)
circle(-20,180)
fd(18)
fd(5)
end_fill()
pu()
seth(270)
fd(40)
rt(90)
fd(20)
pendown()
begin_fill()
seth(90)
fd(10)
circle(-30,120)
circle(-60,90)
circle(-30,70)
circle(20,40)
fd(100)
rt(90)
fd(40)
fd(5)
end_fill()

#手,右2
gtt(50,-120)
begin_fill()
seth(60)
fd(90)
rt(45)
fd(80)
circle(40,40)
fd(40)
circle(-20,180)
fd(18)
fd(5)
end_fill()
pu()
seth(270)
fd(15)
rt(90)
fd(20)
pendown()
begin_fill()
seth(70)
circle(-40,100)
circle(-60,90)
circle(-50,90)
circle(20,40)
fd(100)
rt(90)
fd(70)
fd(5)
end_fill()

#手,左1
gtt(-150,0)
begin_fill()
seth(90)
fd(90)
lt(45)
fd(80)
circle(-40,40)
fd(40)
circle(20,180)
fd(18)
fd(5)
end_fill()
pu()
seth(270)
fd(40)
lt(90)
fd(20)
pendown()
begin_fill()
seth(90)
fd(10)
circle(30,120)
circle(60,90)
circle(30,70)
circle(-20,40)
fd(100)
lt(90)
fd(40)
fd(5)
end_fill()

#手,zuo2
gtt(-60,-150)
begin_fill()
seth(150)
fd(170)
lt(45)
fd(80)
circle(-40,40)
fd(40)
circle(20,180)
fd(18)
fd(5)
end_fill()
pu()
seth(270)
fd(10)
lt(90)
fd(40)
pendown()
begin_fill()
seth(150)
fd(20)
circle(40,100)
circle(60,90)
circle(50,90)
circle(-20,40)
fd(100)
lt(90)
fd(60)
fd(5)
end_fill()

#耳朵
gtt(-190,60)
begin_fill()
seth(70)
circle(-200,40)
circle(-30,90)
fd(100)
fd(5)
end_fill()

pu()
goto(-6,109)
pd()
begin_fill()
seth(50)
circle(-120,40)
circle(-30,60)
circle(-190,50)
fd(5)
end_fill()

#身体
pencolor(60,60,60)
fillcolor(88,201,231)
gtt(-200,-200)
begin_fill()
seth(90)
fd(90)
circle(60,50)
circle(-45,72)
circle(-200,155)
fd(115)
rt(90)
fd(5)
end_fill()

#肚皮
color("white")
gtt(-120,-197)
seth(76)
begin_fill()
pensize(1)
circle(-100,150)
end_fill()

#脸
gtt(-180,40)
pencolor(60,60,60)
pensize(10)
seth(-30)
circle(25,80)
fd(5)
pu()
seth(-20)
fd(50)
pd()
seth(274)
fd(5)
circle(15,155)
fd(7)
rt(120)
fd(5)
circle(28,100)
fd(8)
pu()
seth(20)
fd(40)
pd()
seth(-50)
circle(25,80)
fd(10)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值