socket - java 坦克大战多人联机里面如何进行数据的交互
大家讲道理
大家讲道理 2017-04-18 10:15:37
0
1
473

自己打算用java做个联机版的坦克大战,但是在联机一块卡住了
效果差不多就是:1个服务端,然后很多客户端连接过来,实现多人联机
但是问题来了,首先里面有子弹集合,各种坦克的坐标,我该如何用socket进行传输
就算传输了过去,服务端又如何进行分辨,哪些数据是描述坐标的,哪些数据是描述炮弹的
请大家支个招,给个思路

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all (1)
伊谢尔伦

I have written the backend of VR products before. The simplest solution is:

  • The server is responsible for distributing data

  • Select a host in the client to complete the calculations of the physics engine and then distribute it to the sub-clients

  • The sub-client only synchronizes and receives data, but does not perform calculations.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!