如果 iPhone 上支持 Game Center,如何构建仅支持 Game Center 的游戏?

发布于 2024-09-28 15:32:59 字数 250 浏览 2 评论 0原文

我即将开始构建一款使用 Game Center 成就和高分的 iPhone 游戏,但我也希望有一个可以在没有 Game Center 的 iPhone 上运行的版本(即 iOS 版本 < 4.1) )。我可以在应用程序商店中拥有同一应用程序的两个版本吗?一个用于游戏中心,一个不用于游戏中心?或者我应该设计应用程序,使得如果iPhone没有游戏中心,它就不会使用它,如果有,它就会使用它?

我将继续研究这个问题,只是想我会发布这个问题并同时得到一些反馈。非常感谢!

I'm about to begin building an iPhone game that will make use of Game Center Achievements and high scores, but I'd also like to have a version that works on iPhones that don't have Game Center (i.e. iOS version < 4.1). Can I have two versions of the same app in the app store, one for game center, one for without? Or should I design the app such that if the iPhone doesn't have Game Center, it won't make use of it, and if it does, it will make use of it?

I'm going to continue researching this, just thought I'd post this question and get some feedback in the meantime. Thanks so much!

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

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

发布评论

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

评论(4

染柒℉ 2024-10-05 15:33:00

我也在做同样的事情。如果您有 GameCenter 功能,则可以使用这些功能。如果你不这样做,你就不能。

我不会在没有它的情况下编写游戏,然后再添加它。就我而言,我为非 GC 用户禁用多人游戏。

此外,如果设备具有 GC 功能,您可能希望游戏能够正常运行,但用户当前无法(无论出于何种原因)连接到 GC。

I am doing the same thing. If you have GameCenter capabilities, you can use the features. If you don't, you can't.

I would not program a game without and then add it later. In my case I disable Multiplayer for non-GC users.

Also, you may want your game to work if the device has GC capabilities, but the user cannot, for whatever reason, connect to GC currently.

木落 2024-10-05 15:33:00

您可以使用以下函数来检测设备是否支持Game Center:

BOOL isGameCenterAvailable()
{
    // Check for presence of GKLocalPlayer API.
    Class gcClass = (NSClassFromString(@"GKLocalPlayer"));

    // The device must be running running iOS 4.1 or later.
    NSString *reqSysVer = @"4.1";
    NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
    BOOL osVersionSupported = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);

    return (gcClass && osVersionSupported);
}

但是我发现很多人没有更新到iOS 4.1或者对Game Center很幼稚。尽管下载量很大,但我的游戏用户数量却很少。我实际上正在考虑转向 Open Feint,它比 Game Kit 更容易实现,并且还支持旧设备。

You can use the following function to detect if the device supports Game Center:

BOOL isGameCenterAvailable()
{
    // Check for presence of GKLocalPlayer API.
    Class gcClass = (NSClassFromString(@"GKLocalPlayer"));

    // The device must be running running iOS 4.1 or later.
    NSString *reqSysVer = @"4.1";
    NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
    BOOL osVersionSupported = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);

    return (gcClass && osVersionSupported);
}

However I found that a lot of people have not updated to iOS 4.1 or are naive about Game Center. The number of users in my game is quite small even though there are so many downloads. I was actually considering moving over to Open Feint which is very much easier to implement than Game Kit and also supports older devices.

浮云落日 2024-10-05 15:32:59

这是我从一位苹果工程师那里收到的明确答复……

“我们建议制作一个版本的应用程序,它可以动态检测 Game Center 是否可用,并据此使用(或不使用)它。”

Here's the definitive response I received from one of the Apple engineers...

"We'd recommend making one version of the app which dynamically detects whether Game Center is available and uses it (or not) based on that."

错爱 2024-10-05 15:32:59

也许创建一个没有它的游戏,然后创建游戏中心的功能,但禁用它们,并且只有在它们具有正确的版本时才启用它们。

Maybe create a game without it, then create the capabilities for the game center, but disable them, and only enable them if they have the right version.

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