I'm trying to do something like this.
pygame.event.set_allowed([pygame.KEYDOWN])
for event in pygame.event.get():
. . .
pygame.display.flip()
Since the game I'm making is static when there's no input anyway, I'm trying to avoid re-rendering identical frames between inputs in every single while True iteration. This code seems to be almost working, except there's the slightest (disorienting) delay between input and result. If someone can help me mitigate this I want to go further and put much of the rest of the code within the for event in ... block to optimise a bunch more by skipping iterating over the game state 2D list every loop since it's static until there's input. Thank you.