Quantcast
Viewing latest article 1
Browse Latest Browse All 15

Event handling and threads: Event handling and threads

I just started using python and pygame so my knowledge is slightly limited. I have started programming a game and already have a basic underlying set of objects and game system. WHat I am doing in my main loop at the moment is the following
main loop:
for event in pygame.event…
handle the event

update game system
update the display

THE PROBLEm i have is that updating my game system is huge and uses up to much time causing events to be missed (they seem to not queue in the pygame event queue)
Is there a way i could maybe run an event handler and the updating of the game system or at leaste the update of the display(drawing) in seperate threads to clear up this "lag" or non
registering of the event interuptions?

ANy help,suggestions or refer to sites etc will be helpful
Thanks


Viewing latest article 1
Browse Latest Browse All 15

Trending Articles