0

How can I get user input from front-end of my application while on the backend a game runs in a while loop. So there are multiple agents in my network and only one player. In each iteration random two nodes are chosen from the network in order to interact, agents interact with each other and sometimes with player as well, whenever an agent interacts with the player a user input is required in order to continue the game. However I can't find any way of pausing the game in order to receive data from front-end to continue the game on the backend. Is there a way of handling what I need in node js? The game is implemented in node js. I have shared my code in my previous question and the question is more explaining, here is the link Node application interactively get user input from react front end by pausing the current execution

Ali Beyit
  • 431
  • 1
  • 6
  • 19
  • Sounds like you want to use socket.io – Patrick Hund Feb 10 '19 at 17:49
  • @PatrickHund - Hey I am using sockets currently if you follow the link I provided my code there however socket.io does not block the game loop, it continues to loop with null/empty value which was needed to supplied by the user. – Ali Beyit Feb 10 '19 at 18:15

0 Answers0