猫史档案馆


【Python作品分享】【36强进10】航天明信片——ye土土【作品秀】

用户:土土er土土er查看:3 回复:1 评论:3 创建时间:2021-05-23T23:22:47


【作品展示】

center_image

 

【作品介绍】

这是我的36强作品,花半天赶出来的,就很没 用,不知能进10强么?(应该不行吧)

 

【作品源代码】

import turtle
import time
import pygame
pygame.mixer.init()
name = turtle.textinput('生成明信片', '您的名字')
turtle.hideturtle()
scr = turtle.getscreen()
a = 1
pygame.mixer.music.load('./img/1.mp3')
pygame.mixer.music.play(-1)
scr.setup(1130, 喵5)
turtle.penup()
turtle.goto(-120,0)
turtle.write('点击拆开信封', font=('Arial', 30, 'bold'))
turtle.bgpic(r'./img/1.png')
def gb(x,y):
    global a
    if (a == 1):
        a = 2
        turtle.clear()
        turtle.bgpic(r'./img/2.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/3.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/4.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/5.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/6.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/7.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/8.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/9.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/10.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/11.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/12.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/13.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/14.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/15.png')
        scr.setup(884, 750)
        time.sleep(0.05) 
        turtle.bgpic(r'./img/16.png')
        scr.setup(884, 750)
        time.sleep(0.05)
        turtle.bgpic(r'./img/17.png')
        a=750
        for x in range(30):
            a = a-4
            scr.setup(895, a)

        turtle.goto(-400,200)
        turtle.pencolor("white")
        turtle.write('亲爱的宇航员叔叔:', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,150)
        turtle.write('    您好!', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,110)
        turtle.write('    小时候,我经常在夜晚时靠在窗前看着天上熠熠生辉的星', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,70)
        turtle.write('星。我总对未知且神秘的宇宙感到深深向往,也许,您当初也', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,25)
        turtle.write('是那个看星星的孩子,只是您现在长大了,实现了童年的梦想。', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,-15)
        turtle.write('    宇宙究竟是怎么样的呢?我相信,也会有一天,像您一样', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,-60)
        turtle.write('我也能实现这个美好的心愿,在未来的某一天,随火箭飞去和', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,-100)
        turtle.write('您一起亲眼看到茫茫宇宙。', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(-400,-140)
        turtle.write('此致,敬礼!', font=('Arial', 15, 'bold'))
        time.sleep(1)
        turtle.goto(20,-180)
        turtle.write(f'by {name}', font=('Arial', 15, 'bold'))
        time.sleep(3)
        turtle.bgpic(r'./img/18.png')
        turtle.clear()
        turtle.goto(-300,0)
        turtle.write('点击回顾祖国航天历史', font=('Arial', 30, 'bold'))
        a=3
        def gb2(x,y):
            global a
            if (a==3):
                a=4
                turtle.clear()
                turtle.bgpic(r'./img/19.png')
                def gb3(x,y):
                    global a
                    if (a == 4):
                        a=5
                        turtle.bgpic(r'./img/20.png')
                        def gb4(x,y):
                            global a
                            if (a == 5):
                                a=6
                                turtle.bgpic(r'./img/21.png')
                                def gb5(x,y):
                                    global a
                                    if (a == 6):
                                        a=7
                                        turtle.bgpic(r'./img/22.png')
                                        def gb6(x,y):
                                            global a
                                            if (a == 7):
                                                a=8
                                                turtle.bgpic(r'./img/23.png')
                                                def gb7(x,y):
                                                    global a
                                                    if (a == 8):
                                                        a=9
                                                        turtle.bgpic(r'./img/24.png')
                                                        def gb8(x,y):
                                                            global a
                                                            if (a == 9):
                                                                a=10
                                                                turtle.bgpic(r'./img/25.png')
                                                                def gb9(x,y):
                                                                    global a
                                                                    if (a == 10):
                                                                        a=11
                                                                        turtle.bgpic(r'./img/26.png')
                                                                        def gb10(x,y):
                                                                            global a
                                                                            if (a == 11):
                                                                                a=12
                                                                                turtle.bgpic(r'./img/27.png')
                                                                            
                                                                        scr.onscreenclick(gb10)
                                                                scr.onscreenclick(gb9)
                                                        scr.onscreenclick(gb8)
                                                scr.onscreenclick(gb7)
                                        scr.onscreenclick(gb6)
                                scr.onscreenclick(gb5)
                        scr.onscreenclick(gb4)
                scr.onscreenclick(gb3)
        scr.onscreenclick(gb2)
scr.onscreenclick(gb)
turtle.done()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
浮躁的飓风雀HYKa浮躁的飓风雀HYKa

进十强啦!!!

点赞0


评论