Gamecenter 回合制回合时间限制

发布于 2025-01-03 21:35:42 字数 298 浏览 4 评论 0原文

我正在开发 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 技术交流群。

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

发布评论

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

评论(2

ぶ宁プ宁ぶ 2025-01-10 21:35:42

没有骰子。如果应用程序不运行,您就无法终止游戏。
但是,您可以给用户留下这样的印象,如果您想这样做,可以使用本地通知(请参阅 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)

半暖夏伤 2025-01-10 21:35:42

在iOS 6.0及更高版本中,您可以使用以下方法结束回合

- (void)endTurnWithNextParticipants:(NSArray *)nextParticipants turnTimeout:(NSTimeInterval)timeout matchData:(NSData *)matchData completionHandler:(void (^)(NSError *error))completionHandler

您可以定义超时间隔。如果玩家没有在该时间间隔内进行比赛或比赛,则轮到下一位玩家进行。

In iOS 6.0 and later you can end turns with the following method

- (void)endTurnWithNextParticipants:(NSArray *)nextParticipants turnTimeout:(NSTimeInterval)timeout matchData:(NSData *)matchData completionHandler:(void (^)(NSError *error))completionHandler

You can define you timeout interval. If the player does not take or plays in that interval then the next player takes the turn.

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