python画皮卡丘并上色代码,用python画一只皮卡丘

大家好,小编来为大家解答以下问题,用python画一只可爱的皮卡丘,python画皮卡丘并上色代码,今天让我们一起来看看吧!

给大家看看我的皮卡丘(电脑屏幕比较小,所以看不见假皮卡丘真实的身体):

话不说上代码:

import turtle as t
import random
t.speed(100)
t.pensize(3)
t.color('black')
t.pu()

#头
t.fillcolor('yellow')
t.setposition(-500,300)
t.begin_fill()
t.pd()      
t.left(120)
t.circle(600,-20)
t.pu()
t.left(150)
t.setposition(-500,300)
t.pd()
t.circle(600,25)
t.right(30)
t.circle(150,60)
t.left(15)
t.circle(200,30)
t.left(2)
t.circle(200,50)
t.left(15)
t.circle(150,60)
t.right(90)
t.circle(600,20)
t.left(140)
t.circle(600,25)
t.right(60)
t.circle(150,37)
t.end_fill()
t.pu()

#耳朵涂色

t.setposition(-88,173)
t.fillcolor('black')
t.begin_fill()
t.setposition(-160,162)
t.pd()
t.right(-60)
t.circle(60,50)
t.end_fill()

t.pu()
t.setposition(-500,300)
t.fillcolor('black')
t.begin_fill()
t.pd()
t.setposition(-460,215)
t.right(-90)
t.circle(60,-65)
t.end_fill()
t.pu()

#眼睛
t.fillcolor('black')
t.begin_fill()

t.setposition(-470,0)
t.pd()
t.circle(20,360)
t.end_fill()

t.pu()
t.fillcolor('black')
t.begin_fill()
t.setposition(-350,-5)
t.pd()
t.circle(20,360)
t.end_fill()
t.pu()


#眼睛白
t.fillcolor('white')
t.begin_fill()

t.setposition(-470,10)
t.pd()
t.circle(10,360)
t.end_fill()

t.pu()
t.fillcolor('white')
t.begin_fill()
t.setposition(-350,5)
t.pd()
t.circle(10,360)
t.end_fill()
t.pu()

#鼻子
t.pensize(8)
t.setposition(-410,-20)
t.pd()
t.goto(-395,-20)
t.pu()

#嘴巴
t.setposition(-450,-35)
t.fillcolor("red")
t.begin_fill()
t.pd()
t.circle(45,60)
t.right(53)
t.circle(45,60)
t.pu()
t.setposition(-445,-37)
t.right(115)
t.pd()
t.circle(300,17)
t.left(20)
t.circle(70,10)
t.left(15)
t.circle(70,10)
t.left(15)
t.circle(70,10)
t.left(15)
t.circle(70,10)
t.left(15)
t.circle(70,10)
t.left(5)
t.circle(70,10)
t.left(4)
t.circle(370,10)
t.end_fill()
t.up()

#腮红
t.pensize(5)
t.setposition(-290,-50)

t.fillcolor("red")
t.begin_fill()
t.pd()
t.circle(20,360)
t.left(20)
t.end_fill()
t.pu()


t.setposition(-480,-50)
t.pd()
t.fillcolor("red")
t.begin_fill()
t.circle(20,360)
t.left(20)
t.end_fill()
t.pu()

#身体
t.setposition(-480,-135)

t.fillcolor("yellow")
t.begin_fill()
t.pensize(3)

t.pd()
t.right(240)
t.circle(900,20)
t.pu()

t.setposition(-300,-129)
t.pd()
t.circle(900,25)
t.end_fill()
t.pu()

#尾巴
t.setposition(-285,-250)
t.pd()
t.fillcolor("yellow")
t.begin_fill()
t.goto(-260,-230)
t.goto(-210,-240)
t.goto(-140,-190)
t.goto(-60,-200)
t.goto(-65,-270)
t.goto(-145,-230)
t.goto(-215,-260)
t.goto(-260,-240)
t.goto(-285,-255)
t.end_fill()
t.done()
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值