记第一次使用turtle创作《日常》中的坂本先生

今天看了嵩天老师讲解了python蟒蛇绘制的教程,所以自己就想尝试用turtle画《日常》里的坂本猫,共花费了3个小时,一百多行代码,全是最基础的turtle.函数,应该存在不少冗余。但不管怎样总算是完成了,在此记录。

import turtle as t
#设置画布及画笔
t.colormode(255)

t.bgcolor(231,224,214)
t.pensize(2.5)
t.pencolor(84,84,84)
t.penup()
t.goto(0,-90)
t.pendown()
#画左脸
t.fillcolor(84,84,84)
t.begin_fill()
t.seth(-180)
t.circle(-400,30)
t.goto(-90,300)
t.left(160)
t.circle(-600,13)

#画右脸
t.penup()
t.goto(0,-90)
t.seth(0)
t.pendown()
t.circle(400,30)
t.goto(90,300)
t.right(160)
t.circle(600,13)
t.seth(180)
t.fd(30)

t.penup()
t.goto(0,-90)
t.pendown()
#填充脸颜色
t.end_fill()
#左眼
t.pencolor(57,45,36)
t.penup()
t.home()
t.goto(-90,15)
t.pendown()
t.fillcolor(255,255,255)
t.begin_fill()
t.seth(60)
t.circle(400,10)
t.seth(120)
t.circle(400,10)
t.left(120)
t.circle(400,10)
t.left(30)
t.circle(400,10)
t.end_fill()

#左眼瞳仁
t.penup()
t.goto(-92,45)
t.seth(90)
t.pensize(10)
t.pencolor(39,32,32)
t.pendown()
t.goto(-92,95)

#右眼
t.pensize(2.5)
t.pencolor(57,45,36)
t.penup()
t.home()
t.goto(90,15)
t.pendown()
t.fillcolor(255,255,255)
t.begin_fill()
t.seth(60)
t.circle(400,10)
t.seth(120)
t.circle(400,10)
t.left(120)
t.circle(400,10)
t.left(30)
t.circle(400,10)
t.end_fill()
#右眼瞳仁
t.penup()
t.goto(92,45)
t.seth(90)
t.pensize(10)
t.pencolor(39,32,32)
t.pendown()
t.goto(92,95)

#身子
t.pencolor(84,84,84)
t.penup()
t.goto(-130,-60)
t.right(200)
t.pendown()
t.fillcolor(84,84,84)
t.begin_fill()
t.circle(900,21.6)
t.seth(0)
t.fd(330)
t.left(80)
t.circle(900,21.6)
t.end_fill()
#围巾1
t.pencolor(238,99,94)
t.penup()
t.goto(-140,-70)
t.seth(-15)
t.pendown()
t.fillcolor(238,99,94)
t.begin_fill()
t.circle(500,33)
t.right(150)
t.circle(-600,20)
t.right(65)
t.circle(-600,17)
t.end_fill()
t.pencolor(163,68,62)
t.fillcolor(163,68,62)
t.begin_fill()
t.penup()
t.goto(-140,-70)
t.pendown()
t.seth(-5)
t.circle(-600,17)
t.end_fill()
#围巾2
t.penup()
t.pencolor(238,99,94)
t.pensize(5)
t.goto(-193,1)
t.pendown()
t.seth(-200)
t.begin_fill()
t.fillcolor(238,99,94)
t.circle(-200,40)
t.right(100)
t.circle(-200,40)
t.goto(-193,1)
t.end_fill()
#围巾3
t.penup()
t.goto(193,1)
t.pendown()
t.seth(30)
t.begin_fill()
t.circle(200,50)
t.right(270)
t.circle(200,40)
t.goto(193,1)
t.end_fill()
t.penup()
t.goto(190,40)
t.pendown()
t.seth(30)
t.pencolor(163,68,62)
t.begin_fill()
t.fillcolor(163,68,62)
t.goto(250,100)
t.goto(190,40)
t.end_fill()
t.done()

 ↑真正的坂本先生

↑我画的坂本先生(XD眼睛小了一倍!) 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值