【问题标题】:PhoneGap Online Game [closed]PhoneGap 在线游戏[关闭]
【发布时间】:2014-04-26 19:01:45
【问题描述】:

我正在使用 cordova/phonegap 3.4.0 创建一个应用程序,并尝试实现多人游戏模式。该应用程序是一个得分游戏,得分最高的人获胜。我已经创建了游戏,需要一种方法来执行以下操作:

- Check when both people are connected
- Send the final score to each device (eg. Device A = 42 and Device B = 39 - Send them to each         
other to compare scores)
- Recieve the other players score to determine who the winner is. 

这可以是 phonegap 插件格式或 javascript 文件。

有没有人对我如何实现这一点有任何想法。我试图找到一个phonegap插件没有成功。

提前感谢大家的帮助。

【问题讨论】:

  • 你的问题是......?到目前为止,您尝试了什么,您的代码在哪里?
  • 你知道我可以做上面提到的吗?

标签: javascript ios cordova multiplayer


【解决方案1】:

了解 WebSockets API,您还需要了解如何创建 WebSocket 服务器,然后您需要了解 NodeJS 或您首选的服务器语言(PHP、Java、Python 等)

WebSockets Api 是在 iOS 6 中引入的,查看以下链接参考http://caniuse.com/websockets,使用Phonegap 不会有问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-29
    • 1970-01-01
    • 2012-03-06
    • 1970-01-01
    • 2014-11-08
    • 2021-07-22
    相关资源
    最近更新 更多