如何为游戏设置 Android 对等网络?

发布于 2024-11-02 23:06:16 字数 236 浏览 0 评论 0原文

因此,在了解如何在图像中制作透明度之后,我能够在我们的游戏中正确使用我的一些朋友的图像。我们的目标是让 3 个相邻的人可以一起玩游戏。这个想法是,你可以点击并击退一波又一波的小坏人。我有点击、射击、生成坏人和碰撞检测,但现在我想了解 Android 上的点对点网络?或者这不是你的社交方式?我完全错了吗?您将如何建立一个不超过 4 名当地人的基本网络?堆栈溢出说这是固执己见的,但我只是更好奇避免常见陷阱的方法以及如何解决这个问题。{

谢谢,

So after finding out how to make transparencies in my images, i was able to use some of my friends images properly for our game. Our goal was to have a game where 3 people who were next to each other, could play the game together. The idea was that you would point and click and fight off waves of little bad guys. I have the point and click, the shooting, the spawning bad guys, and the collision detection ,but now I want to learn about peer to peer networking on the android? Or is this not how you network? Am i completely wrong? How would you set up a basic network of no more than 4 local people? stack overflow said that was opinionated, but i was just more curious of ways to avoid common pitfalls and where to turn for this.{

Thank you,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

韶华倾负 2024-11-09 23:06:16

有几种不同的方法可以做到这一点,这实际上取决于哪一种最适合您的情况。

  • 如果您想要完整的临时方法并且您有合适的手机,请查看 Wifi直接
  • 使用网络服务器协调消息交换
  • 根据您的游戏和玩家之间的距离,您可能能够使用小型蓝牙网络

There are a couple different ways you can do this, it really depends on which one is the best fit for your situation.

  • If you want a complete ad-hoc approach and you have the right phone, take a look at Wifi Direct.
  • Use a Web server to coordinate message exchanges
  • Depending on your Game and the distance between players you may be able to use a small Bluetooth network
绳情 2024-11-09 23:06:16

正如 dbryson 所建议的,您可以使用 WiFi Direct。但它仅适用于 OS 4.0 ICS 及更高版本。以下是一些链接:

http://developer.android.com/guide/topics/ wireless/wifip2p.html

http://developer.android.com/资源/样本/WiFiDirectDemo/index.html

As dbryson suggested, you can use WiFi Direct. However it only works for OS 4.0 ICS and higher. Here are some links:

http://developer.android.com/guide/topics/wireless/wifip2p.html

http://developer.android.com/resources/samples/WiFiDirectDemo/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文