Answer the question
In order to leave comments, you need to log in
How to correctly build the architecture of a django application for a multiplayer snake?
Wrote a snake that can be played by multiple clients. Initially, the player chooses a name for himself and is redirected to a page with a square field. 1 time per second, the client contacts the server for the location of all the squares (snakes and everything else) and receives json, which then updates the entire field and so on every second.
The game slows down a bit. I would like to get advice on how to improve the game from more experienced guys.
Answer the question
In order to leave comments, you need to log in
1 time per second, the client contacts the server for the location of all the squares (snakes and everything else) and receives json, which then updates the entire field and so on every second.
Use some kind of websocket implementation. Usually there is a chat in the examples. This example will be quite enough for you because everything else has already been written.
There is flask-socketio for python, socketio for javascript, other languages also have their own implementations.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question