Skip to content Skip to sidebar Skip to footer

Pygame Module Recognises Clicks While The Program Is Paused With Pygame.time.delay(x)

I'm currently learning to program my first Python games with the module 'pygame'. I've already programmed a Spaceship shooter game with the help of a video tutorial and now I'm pro

Solution 1:

When calling pygame.time.delay(2000) events are still stored in the event queue, which is then used and emptied by pygame.event.get().
In order to ignore any events happening during the 2 seconds you can just call pygame.event.get() directly after the 2 s delay. I would recommend to still check if a pygame.QUIT event is in this pygame.event.get() because this event would be discarded as well.


Post a Comment for "Pygame Module Recognises Clicks While The Program Is Paused With Pygame.time.delay(x)"