Gamecenter 回合制回合时间限制
我正在开发 iphone & ipad,游戏中心回合制游戏。
我想为每个回合设定一个时间限制。每个玩家只有 48 小时的时间来完成自己的回合。当玩家时间不多时,他/她应该收到通知,要求其加快速度。 如果玩家没有在时限内轮到,他就会退出游戏(并收到另一条通知)。 流行的游戏 Wordfeud 就是这样工作的,但他们有自己的服务器(不是通过苹果的游戏中心)。
据我所知,NSNotificationCenter 只有一个针对 GameCenter 的通知,那就是身份验证确实发生了变化。
有谁知道如何在我的游戏中实现这些通知?
I'm working on a iphone & ipad, gamecenter turnbased game.
I would like to build-in a time limit for each turn. Every player should only have 48 hours to complete their turn. When the player is running out of time, he/she should get a notification to hurry up.
If a player doesn't take the turn within the time limit, he's out of the game (and gets another notification).
The popular game Wordfeud works like this but they have there own server (not via Apple's gameCenter).
As far as I know, NSNotificationCenter has only one notification for GameCenter and that is Authentication did change.
Does anyone have an idea how to implement these notifications in my game ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有骰子。如果应用程序不运行,您就无法终止游戏。
但是,您可以给用户留下这样的印象,如果您想这样做,可以使用本地通知(请参阅
UILocalNotification
和-[UIApplication ScheduleLocalNotification:]
了解一种方法开始)no dice. you can't kill the games without the app running.
However, you can give the user the impression of it, if you want to do so you can use local notifications (see
UILocalNotification
and-[UIApplication scheduleLocalNotification:]
for a way to start)在iOS 6.0及更高版本中,您可以使用以下方法结束回合
您可以定义超时间隔。如果玩家没有在该时间间隔内进行比赛或比赛,则轮到下一位玩家进行。
In iOS 6.0 and later you can end turns with the following method
You can define you timeout interval. If the player does not take or plays in that interval then the next player takes the turn.