ブラウザベースのチェスゲームを作りたいです。2人のユーザーが交代で同じボード上で動きます。
現時点では、ノードサーバーによって行われたREST呼び出しをピックアップするSpringを備えたTomcatサーバーを起動しました。
ただし、ユーザーが移動するたびに休憩を取ります。サーバー側で行うことはほとんどないため、応答は非常に迅速に行われます。
しかし、これは最善のアプローチではないかもしれないと私は感じています。このシナリオでは、より良い代替手段がありますか、それともRESTコールで十分でしょうか?
You can use the websocket.io with nodejs for the real-time communication between users.
If you don't want to use the server at all then you can use the webrtc that uses peer to peer connection.
Here are few useful references:
https://dev.to/rynobax_7/creating-a-multiplayer-game-with-webrtc
https://rynobax.github.io/jump-game
https://github.com/jwagner/webrtc-pong
https://www.webrtc-experiment.com/#featured
For Nodejs and socket.io
https://github.com/fbaiodias/phaser-multiplayer-game
Thanks
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加