猫史档案馆


【Python作品分享】飞机大战

用户:梁辰晖梁辰晖查看:0 回复:0 评论:0 创建时间:2023-01-16T18:49:45


【作品展示】

center_image

 

【作品介绍】

 

【作品源代码】

import pygame

FPS = 60
WIDTH = 500
HEIGTH = 600
WHITE = (255, 255, 255)

# 游戏初始化
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGTH))
pygame.display.set_caption('飞机大战')
clock = pygame.time.Clock()


class Player(pygame.sprite.Sprite):
    def _init_(self):
       pygame.sprite.Sprite._init_(self)


running = True
while running:
    clock.tick(FPS)
    for event in pygame.event.get():
        if (event.type == pygame.QUIT):
            running = False
    screen.fill(WHITE)
    pygame.display.update()
pygame.quit()

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页