本帖最后由 仙女劫 于 2021-3-31 21:53 编辑
[Python] 纯文本查看 复制代码 import sys
import pygame
class AlienInvasion:
def __init__(self):
pygame.init()
self.screen = pygame.display.set_mode((1200, 800))
# self.screen = pygame.display.set_mode((self.settings.screen_width, self.settings.screen_height))
pygame.display.set_caption("Alien Invasion")
def run_game(self):
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
pygame.display.flip()
if __name__ == '_main_':
ai = AlienInvasion()
ai.run_game()
|