B
B
bitbuff2017-09-13 19:35:28
Django
bitbuff, 2017-09-13 19:35:28

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

2 answer(s)
A
Alexander Aksentiev, 2017-09-13
@Sanasol

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.

websocket
and here php?

A
asd111, 2017-09-14
@asd111

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 question

Ask a Question

731 491 924 answers to any question