猫史档案馆


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

用户:无邪的飞叶龙gyxw无邪的飞叶龙gyxw查看:0 回复:1 评论:0 创建时间:2021-05-05T21:47:15


【作品展示】

center_image

 

【作品介绍】

我是一个学习了半个月的编程萌新,希望大家喜欢我的作品 ^-^

 

【作品源代码】

import pygame
import sys
import math
import random
pygame.init()

pygame.display.set_caption('hello world')

size = width, height = 1080, 606
screen = pygame.display.set_mode(size)
pygame.display.set_caption('我的游戏')

turtles = [
    pygame.image.load("kaishi.jpg"),
    pygame.image.load("kaishi1.jpg"),
    pygame.image.load("kaishi2.jpg"),
    pygame.image.load("kaishi3.jpg"),
    pygame.image.load("kaishi4.jpg"),
    pygame.image.load("kaishi5.jpg"),
    pygame.image.load("kaishi6.jpg"),
    pygame.image.load("kaishi7.jpg"),
    pygame.image.load("kaishi8.jpg"),
    pygame.image.load("kaishi9.jpg"),
    pygame.image.load("kaishi10.jpg"),
    pygame.image.load("kaishi11.jpg"),
    pygame.image.load("kaishi12.jpg"),
    pygame.image.load("kaishi13.jpg"),
    pygame.image.load("kaishi14.jpg"),
    pygame.image.load("guocheng.jpg"),
    pygame.image.load("guocheng1.jpg"),
    pygame.image.load("guocheng2.jpg"),
    pygame.image.load("guocheng3.jpg"),
    pygame.image.load("guocheng4.jpg"),
    pygame.image.load("guocheng5.jpg"),
    pygame.image.load("guocheng6.jpg"),
    pygame.image.load("guocheng7.jpg"),
    pygame.image.load("guocheng8.jpg"),
    pygame.image.load("guocheng9.jpg"),
    pygame.image.load("guocheng10.jpg"),
    pygame.image.load("guocheng11.jpg"),
    pygame.image.load("guocheng12.jpg"),
    pygame.image.load("guocheng13.jpg"),
    pygame.image.load("guocheng14.jpg"),
    pygame.image.load("guocheng15.jpg"),
    pygame.image.load("guocheng16.jpg"),
    pygame.image.load("guocheng17.jpg"),
    pygame.image.load("guocheng18.jpg"),
    pygame.image.load("guocheng19.jpg"),
    pygame.image.load("guocheng20.jpg"),
    pygame.image.load("guocheng21.jpg"),
    pygame.image.load("guocheng22.jpg"),
    pygame.image.load("guocheng23.jpg"),
    pygame.image.load("guocheng24.jpg"),
    pygame.image.load("guocheng25.jpg"),
    pygame.image.load("guocheng26.jpg"),
    pygame.image.load("guocheng27.jpg"),
    pygame.image.load("guocheng28.jpg"),
    pygame.image.load("guocheng29.jpg"),
    pygame.image.load("guocheng30.jpg"),
    pygame.image.load("guocheng31.jpg"),
    pygame.image.load("guocheng32.jpg"),
    pygame.image.load("guocheng34.jpg"),
    pygame.image.load("guocheng35.jpg"),
    pygame.image.load("guocheng36.jpg"),
    pygame.image.load("guocheng37.jpg"),
    pygame.image.load("guocheng38.jpg"),
    pygame.image.load("guocheng39.jpg"),
    pygame.image.load("guocheng40.jpg"),
    pygame.image.load("guocheng41.jpg"),
    pygame.image.load("guocheng42.jpg"),
    pygame.image.load("guocheng43.jpg"),
    pygame.image.load("guocheng44.jpg"),
    pygame.image.load("guocheng45.jpg"),
    pygame.image.load("guocheng46.jpg"),
    pygame.image.load("wancheng.jpg"),
    pygame.image.load("wancheng1.jpg"),
    pygame.image.load("wancheng2.jpg"),
    pygame.image.load("wancheng3.jpg"),
    pygame.image.load("wancheng4.jpg"),
    pygame.image.load("wancheng5.jpg"),
    pygame.image.load("wancheng6.jpg"),
    pygame.image.load("wancheng7.jpg"),
    pygame.image.load("wancheng8.jpg"),
    pygame.image.load("wancheng9.jpg"),
    pygame.image.load("wancheng10.jpg"),
    pygame.image.load("wancheng11.jpg"),
    pygame.image.load("wancheng19.jpg"),
    pygame.image.load("wancheng18.jpg"),
    pygame.image.load("wancheng17.jpg"),
    pygame.image.load("wancheng16.jpg"),
    pygame.image.load("wancheng15.jpg"),
    pygame.image.load("wancheng14.jpg"),
    pygame.image.load("wancheng13.jpg"),
    pygame.image.load("wancheng12.jpg"),
    pygame.image.load("完成.jpg"),
    pygame.image.load("完成.jpg"),
    pygame.image.load("完成.jpg"),
    pygame.image.load("完成.jpg"),
    pygame.image.load("完成.jpg"),
    pygame.image.load("登陆.jpg"),
    pygame.image.load("登陆1.jpg"),
    pygame.image.load("登陆2.jpg"),
    pygame.image.load("登陆3.jpg"),
    pygame.image.load("登陆4.jpg"),
    pygame.image.load("登陆5.jpg"),
    pygame.image.load("登陆6.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆7.jpg"),
    pygame.image.load("登陆8.jpg"),
    pygame.image.load("登陆9.jpg"),
    pygame.image.load("登陆10.jpg"),
    pygame.image.load("登陆11.jpg"),
    pygame.image.load("登陆11.jpg"),
    pygame.image.load("登陆11.jpg"),
    pygame.image.load("登陆11.jpg"),
    pygame.image.load("登陆11.jpg"),
    pygame.image.load("登陆12.jpg"),
    pygame.image.load("登陆13.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆14.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆15.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
    pygame.image.load("登陆16.jpg"),
]

i = 0

clock = pygame.time.Clock()

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            sys.exit()

    screen.blit(turtles[i %150 ], [0, 0])
    i = i + 1
    pygame.display.flip()
    clock.tick(12)
    pygame.display.update()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
无题_无题_

比赛不可以使用pygame库哦~

点赞0


评论