如何开发Android WLAN多人游戏?
我目前正在尝试为 Android 开发一款多人纸牌游戏。
计划:
使用java套接字通过WLAN进行通信。
游戏:
第 1 步。启动屏幕(显示的第一个画布)要求输入昵称。
步骤2.搜索/加入可用的游戏房间或创建游戏房间。
步骤 3. 玩
问题: 1. 这可能吗?创建房间的设备将作为服务器运行,任何连接的人都将作为客户端(这一切都是在 WLAN 中完成的)。
如何搜索/广播可用的游戏室?
有人可以给我指点一个好的教程吗?我发现了很多,但没有帮助。这是我第一次开发游戏。非常感谢有关任何回合制纸牌游戏的教程。
谢谢你们!
I'm currently trying to develop a multiplayer card game for Android.
Plan:
use java sockets for communication through WLAN.
The Game:
step 1.the splash screen(first canvas to display) asks for a nickname.
step 2.search/join available game room or create a game room.
step 3. play
questions :
1. Is this possible? The device who created a room will run as the server and anyone connecting will be client (this is all done in WLAN).
How can I search/broadcast the available game rooms?
Can anyone point me to a good tutorial? I found plenty but didn't help. This is my first time developing a game. A tutorial about any turn-based card game is very much appreciated.
thanks guys!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想使用 Wifi 连接,则需要考虑到该设备没有不同的 IP 地址,因此您只能进行近距离多人游戏(在同一 Wifi 网络上),但我想这不是结果你想要实现的目标。
可以创建您所描述的内容。为了拥有游戏室并拥有真正的在线多人游戏功能,您必须使用服务器,所有客户端都将与服务器进行通信并获取更新的信息。现在,这听起来很可怕,但您不需要发明轮子,您可以使用现有的游戏服务器(例如 Skiller 多人游戏 SDK)。下载地址:http://dev.skiller-games.com 令人惊讶的是,您不必下载服务器,他们会负责托管)。
既然我们已经确定连接不是问题,我可以告诉您,真正的挑战是创建一个有吸引力的多人游戏逻辑。尝试让你的游戏快速(这样用户就不必等待很长一段时间才能看到彼此的动作)并始终引起用户的兴趣(当打开新游戏并等待其他用户加入时,用户可以与计算机一起玩) ?)
希望我有帮助。
If you want to use the Wifi connectivity you need to take into consideration the fact that the device does not have a distinct IP address so you could only make close proximity multiplayer (on the same Wifi network), but i guess that is not the result you want to achieve.
It is possible to create what you have described. In order to have game rooms and have a real online multiplayer capabilities, you would have to use server, which all clients would communicate with and get the updated information. Now, that sounds scary but you do not need to invent the wheel and you can use an existing game sever (ex. Skiller multiplayer SDK. download from: http://dev.skiller-games.com and surprisingly, you do not have to download the server, they take care of the hosting).
Now that we have established that the connectivity in not a problem, i can tell you that the real challenge is to create an appealing a multiplayer game logic. Try to make your game quick (so users wouldn't have to wait long periods of time for each others moves) and always interest the user (when opening a new game and waiting for another user to join, the user can play with the computer?)
Hope i helped.