Skip to content Skip to sidebar Skip to footer

Pygame Multithreading

I have a multiplayer game that runs on pygame. I am running the game/client/server in separate threads and have a simple echo server. Each time a player broadcasts a message, every

Solution 1:

I suggest you to read carefully Queue docs http://docs.python.org/2/library/queue.html and threading docs http://docs.python.org/2/library/threading.html. Your decision to use while True: does not look very well. Please read about locks/semaphores/mutex/events and check these simple examples http://www.tutorialspoint.com/python/python_multithreading.htm and I am sure that you will be able to create better multithreading architecture.


Post a Comment for "Pygame Multithreading"