问题: pygame.key.get_pressed()不工作
stack overflow找到了答案
原因及解决方法: The problem is that you don’t process pygame’s event queue. You should simple call pygame.event.pump() at the end of your loop and then your code works fine。
(在循环的最后面加一句pygame.event.pump)

贴上别人的问题描述:
在这里插入图片描述
网友提供的解决方法:
在这里插入图片描述在这里插入图片描述