main.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:PyPong 作者: Starlight42 项目源码 文件源码
def main():
    print('Press return to start the game')

    pygame.init()
    RUN = True
    screen = pygame.display.set_mode(SCREEN_SIZE)
    background = pygame.image.load(BG_PATH).convert_alpha()
    pygame.display.set_caption('PyPong')
    menu = MainMenu(screen)

    while RUN:
        for event in pygame.event.get():
            if event.type == QUIT or \
                    (event.type == KEYDOWN and event.key == K_ESCAPE):
                RUN = False
            if event.type == KEYDOWN and event.key == K_RETURN:
                menu.start()

        pygame.draw.rect(screen, BLACK, SCREEN_ORI + SCREEN_SIZE)
        screen.blit(background, SCREEN_ORI)
        pygame.display.flip()

    pygame.quit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号