Answer the question
In order to leave comments, you need to log in
How to connect 2 users on the site?
How can you implement a connection of 2 people on the site, for example, in the game sea battle, so that 2 people can play with each other?
I decided to try to establish a connection for this purpose with long requests, but I can’t catch up on how to connect two users.
Answer the question
In order to leave comments, you need to log in
Your server should store the state of each of the players and process all the logic, and give the clients only a render of this state and receive commands to change it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question