猫史档案馆


【Python作品分享】02-荷塘青蛙-工程包

用户:回来还是回来还是查看:0 回复:0 评论:0 创建时间:2022-10-29T17:44:53


【作品展示】

center_image

 

【作品介绍】

sb

 

【作品源代码】

import turtle as t

p = t.Pen()
t.setup(800, 500)
t.bgpic('背景图.png')
p.color('green')
# 绘制树冠
p.up()
p.goto(-130,200)
p.down()
p.setheading(-60)
p.begin_fill()
for i in range(3):
    p.forward(100)
    p.right(120)
p.end_fill()


p.up()
p.goto(-130, 150)
p.down()
p.setheading(-60)
p.begin_fill()
for i in range(3):
    p.forward(115)
    p.right(120)
p.end_fill()

p.up()
p.goto(-130, 108)
p.down()
p.setheading(-60)
p.begin_fill()
for i in range(3):
    p.forward(135)
    p.right(120)
p.end_fill()
# 绘制树干
p.color('SaddleBrown')
p.penup()
p.goto((-145), (-10))
p.pendown()
p.setheading(0)
p.begin_fill()
for i in range(2):
    p.forward(30)
    p.right(90)
    p.forward(70)
    p.right(90)
p.end_fill()
# 绘制眼睛
p.color('black')
p.up()
p.goto(200,-40)
p.down()
p.begin_fill()
p.circle(10)
p.end_fill()

p.color('black')
p.up()
p.goto(245, -40)
p.down()
p.begin_fill()
p.circle(10)
p.end_fill()
p.up()
p.goto(0, 0)
p.setheading(90)
p.down()
#p.goto(245,-40)
t.done()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页