get() retrieves all the events in the queue in the queue, and is usually used in a loop:
for event in pygame.event.get(): # use event
poll() retrieves only one event:
event = pygame.event.poll() # use event
In the latter case, you will need to explicitly check if the event type is pygame.NOEVENT ; in the first cycle it simply wonβt work if there are no events.
As a rule, the version of get() most often used.
jonrsharpe
source share