slither.py 文件源码

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

项目:Slither 作者: PySlither 项目源码 文件源码
def runMainLoop(frameFunc):
    while True:
        blit(globalscreen)
        frameFunc()
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                if runQuitCallback():
                    # runQuitCallback would run the function
                    # given to setQuitCallback, and return its result
                    pygame.quit()
                    sys.exit()
            else:
                if event.type == pygame.KEYDOWN:
                    keysPressed.append(pygame.key.name(event.key))
                elif event.type == pygame.KEYUP:
                    keysPressed.remove(pygame.key.name(event.key))
                eventCallbacks[event.type](event)
                # eventCallbacks would be a dictionary mapping
                # event types to handler functions.
        pygame.display.flip() # Always flip at the end
        clock.tick(projectFPS) # Run at however many FPS the user specifies
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号