iPhone应用程序:如何实现应用内购买的游戏关卡

发布于 2024-08-28 06:41:41 字数 407 浏览 7 评论 0 原文

因此,我了解到可以为 iPhone 应用程序设置应用内购买来购买游戏关卡等非消耗品。我理解购买部分背后的逻辑,但我不明白的是,我怎样才能交付新的游戏关卡。

例如:我构建了一个包含第一个级别的应用程序,他们购买了额外的级别。是否最好将所有其他级别构建到应用程序中,并且每当他们购买应用程序时,它都会通过 plist 条目或其他内容来解锁它?对我来说这似乎不太能更新。每次我想出一个新关卡时,我都必须更新应用程序。

那么,我不明白的是,如何打包一个关卡并将其下载为游戏可以访问的单独实体?关卡只是一些带有 ZIP 文件夹中的图像的 XML 吗?关卡如何添加到游戏中?此类事情的最佳实践是什么?

我用谷歌搜索并没有找到任何关于此的信息。 我对这个概念有点困惑,任何帮助将不胜感激。我不是在找人为我编写游戏,我只是需要指明正确的方向,这样我就可以自己开发它。

So, I understand that it's possible to set up in-app purchases for iPhone apps to purchase non-consumables like game levels. I understand the logic behind the purchase part, but what I don't understand is, how can I deliver the new game level.

For example: I build an app that contains the first level and they purchase additional levels. Is it better to build all the other levels into the app and whenever they purchase the app, it unlocks it with a plist entry or something? That doesn't seem very update-able to me. Every time I come up with a new level, I'd have to update the app.

So, what I don't understand then, is what is how do I package up a level and download it as a separate entity that can accessed by the game? Would the level just be some XML with images in a ZIP folder or something? How does the level get added to the game? What are best practices for this type of thing?

I Googled and have found NOTHING about this.
I'm a little bit confused by the concept and any help would be appreciated. I'm not looking for someone to write the game for me, I just need pointed in the right direction so I can develop it on my own.

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

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

发布评论

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

评论(2

半暖夏伤 2024-09-04 06:41:41

你的游戏等级是你想要的;毕竟你是设计师。

您应该查看 NSBundle 文档,其中可以包括属性列表、图像资源(等)以及其他代码。打包您的捆绑包(zip 很方便),使用 NSURLConnection 异步下载,然后检查 NSDocuments 目录中的捆绑包并使用 NSBundle 加载进行安装。

或者对于使用现有资源的简单游戏关卡,只需下载描述它的 plist 即可。

您不需要拥有自己的服务器;如果您有 MobileMe 帐户或任何类似服务,则可以从 me.com 下载。

Your game level is whatever you want it to be; you are the designer, after all.

You should look at NSBundle documentation, which can include property lists, image resources (etc) as well as additional code. Package your bundle (zip is convenient), download asynchronously using NSURLConnection, and install be checking the NSDocuments directory for bundles and load with NSBundle.

Or for a simple game level using existing resources, just download a plist that describes it.

You don't need to have your own server; you can download from me.com if you have a MobileMe account, or any similar service.

陌生 2024-09-04 06:41:41

我会阅读 应用内购买编程指南。它有您需要的所有信息。

总之:用户将执行应用内购买并从 Apple 获得数字收据。然后,您的 iPhone 应用程序应联系您的服务器以下载新级别,并使用收据作为 购买验证

如果您没有可用于分发关卡的服务器,您可能需要考虑第三方服务,例如 城市飞艇

I would read over the In-App Purchase Programming Guide. It has all the info you need.

In summary: a user will perform the in-app purchase and get a digital receipt from Apple. Your iPhone application should then contact your server to download the new levels, using the receipt as a verification of purchase.

If you don't have a server available to distribute your levels, you might want to consider a third-party service such as UrbanAirship.

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