Good day! I had a task to implement multiplayer tic-tac-toe in the classical form of the PHP language using jQuery, CSS3, AJAX, JSON according to the principles of MVC and OOP. So I have such a question on JQuery that some convenient plugins allow you to implement such a game. Interested in the following:

  • How to implement the application of the image on the image (for example, the crosses that crossed the diagonal will be crossed by a solid line on top and the game will end)?
  • How will the events of clicks be processed on the free field zone, to draw the subsequent cross or player’s circle (this data will be entered into the database and transferred to another player 2 at another computer, what did player 1 look like)?
  • How to track that the player did not close the browser, that both participants of the game are in the game (processing also the events of early termination of the game by someone, exit from the browser for example)?

Along the way, there may still be a couple of questions, but so far only that. Who implemented this answer, how can you effectively and correctly implement such a toy without reloading the browser window in real time? I would be grateful for all the advice, comments and suggestions ...

    1 answer 1

    tic tac toe -.- zhestzhest ....

    1) divas and layering over each other

    2) the methods of implementation are different, either directly or through the database and there will be a timer that is triggered every second and receives the current field.

    3) also, either a direct connection to the server on the principle of client-server, or through the database. (the timer that is triggered every second will transmit the status)

    there will be questions write in Skype - Manitikyl

    • I understand the timer on jQuery, yes? For example, setInterval, which will check the database at regular intervals for whether the playing field has changed or not. Do you understand? - IntegralAL