python画恐龙,python龟龟地图小恐龙(小猪页),pythonturtle,海龟,绘图,佩奇,里,的

0ef3e452c29f5f325208c25e57349b7b.png

python零基础 turtle库绘制《小猪佩奇》里的小恐龙

python代码

#dinosaur.py

import turtle as t

#龙身

t.setup(1000,600) # 设置画布的大小

t.speed(10) # 设置画笔速度为10

t.pensize(5) # 设置画笔大小

t.pencolor("SpringGreen4") # 设置画笔颜色

t.penup() # 提笔

t.goto(250,180) # 画笔前往坐标(250,180)

t.begin_fill() # 准备填充

t.pendown() # 落笔

t.seth(120) # 画笔角度为120°

t.circle(100,140) # 画一个半径为100,角度为140°的圆

t.seth(-96)

t.fd(120) # 向前移动120

t.circle(-100,50)

t.circle(-80,23)

t.seth(176)

t.fd(20)

t.seth(180)

t.circle(-315,40)

t.seth(270)

t.circle(50,30)

t.circle(10,3)

t.seth(-60)

t.circle(180,40)

t.circle(500,20)

t.circle(750,8)

t.circle(80,60)

t.circle(70,30)

t.fd(90)

t.circle(-80,30)

t.seth(10)

t.fd(60)

t.seth(160)

t.fd(90)

t.seth(22)

t.fd(89)

t.color("LightGreen") # 设置填充颜色

#t.color('SpringGreen1')

t.end_fill() # 依据轮廓填充

7e283f500dc156ee66927dca9ce1f906.png

#龙眼

t.pensize(5)

t.pencolor("SpringGreen4")

t.penup()

t.goto(128,165)

t.pendown()

t.begin_fill()

t.seth(0)

t.circle(20,360)

t.color((1,1,1)) #填充颜色为白色

t.end_fill()

t.penup()

t.goto(128,185)

t.pendown()

t.seth(0)

t.pensize(15)

t.pencolor((0,0,0))

t.circle(1,360)

t.pensize(5)

t.pencolor("SpringGreen4"

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值