Pausing Pygame
Sometimes when developing games, what you see on the screen happens too fast for you to make sense of it. You can try print statements, or you can take the time to learn an external debugger, which would probably be overkill for what you want it to do right now. One solution i've found when writing games for pygame is to just not let the main while loop finish until you're ready. To that end, I did this:
keepGoing = True
while keepGoing:
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepGoing = False
pygame.display.update()
NextFrame = False
while not NextFrame:
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepGoing = False
if event.type == pygame.KEYDOWN:
NextFrame = True