猫史档案馆


【Python作品分享】【去太空,趣编程】画火箭

用户:浮躁的飓风雀HYKa浮躁的飓风雀HYKa查看:0 回复:0 评论:0 创建时间:2021-05-05T18:11:33


【作品展示】

*******************************************************************************************************

【作品介绍】

画火箭,运行一下哈emotion_可怜

【作品源代码】

import random, turtle, tkinter

t = turtle.Pen()
turtle.bgcolor('DarkBlue')
t.speed(0)
t.setheading(135)
t.pensize(5)
t.up()
xLocation, yLocation, threadss = [], [], []
for i in range(random.randint(100, 160)):
    xLocation.append(random.randint(-300, 300))
    yLocation.append(random.randint(-300, 300))
    t.goto(xLocation[i], yLocation[i])
    t.dot(5, 'LightYellow')
t.goto(240, 240)
t.down()
t.color('white')
t.fillcolor('CornFlowerBlue')
t.begin_fill()
t.circle(70, steps=3)
t.end_fill()
t.right(-60)
t.forward(120)
t.setheading(-135)
t.fillcolor('yellow')
t.begin_fill()
for i in range(2):
    t.forward(200)
    t.left(90)
    t.forward(120)
    t.left(90)
t.end_fill()
t.forward(200)
t.right(30)
for i in range(2):
    t.fillcolor('FireBrick')
    t.begin_fill()
    t.circle(35, steps=3)
    t.end_fill()
    t.up()
    t.left(120)
    t.forward(60)
    t.right(120)
    t.down()
t.up()
t.goto(100, 100)
t.dot(90, 'Skyblue')
t.dot(80, 'Cyan')
t.goto(-300, -300)
t.dot(590, 'DarkGoldenRod')
t.dot(580, 'Gold')
t.goto(170, -190)
t.color('white')
t.write('去太空,\n去编程!', align='center', font=('楷体', 50))
t.hideturtle()
print(globals())
turtle.mainloop()

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页