Hi, I have a question. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hi, I have a question.

I’m doing a project, it consist in making a game where i have pawns and flags, and the players have to give orders to the pawns in order to reach the nearest flag. The problem is that every player proces must to place the pawns in turns, not all the players togheter. How can I syncronize the player processes?

12th Jan 2020, 2:17 PM
Sofia Amaolo
Sofia Amaolo - avatar
1 Answer
0
Why are you using one process (maybe thread) per player? If I were you I would use only one thread which calls in turn a function using the player as argument, or a specific player method. Else you have to use - according to the OS and the language - events or messages.
12th Jan 2020, 4:35 PM
Bilbo Baggins
Bilbo Baggins - avatar