iPhone Deck 游戏循环
任何人都可以告诉运行游戏循环的最佳方法,如 Uno 或 Herats(Deck Game)
[CPU2 turn];
[CPU3 turn];
[User turn]; // Wait to get user input before proceed to [CPU4 turn]
[CPU4 turn];
can anyone tell the best approach to run game loop like Uno or Herats (Deck Game)
[CPU2 turn];
[CPU3 turn];
[User turn]; // Wait to get user input before proceed to [CPU4 turn]
[CPU4 turn];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您可以将轮流转换为放置到 NSOperationQueue 中的 NSOperation 子类实例,该实例设置为仅允许一个并发轮流/操作。在这种情况下,轮次按先进先出 (FIFO) 顺序处理。您可以在 Apple 的管理并发文档中了解更多相关信息。
Perhaps you could make turns into
NSOperation
subclass instances placed into anNSOperationQueue
, which is set to allow only one concurrent turn/operation. In this case, turns are handled in first-in-first-out (FIFO) order. You can read more about this in Apple's Managing Concurrency document.