IPhone App: How to Implement Purchased Game Levels in the App
So my understanding is that it is possible to set up in-app purchases for the iPhone to purchase non-consumables such as game levels. I understand the logic of the purchase, but I don't understand how I can deliver the new game level.
For example: I create an app that contains the first level and they acquire additional levels. Is it better to build all the other levels in the app and whenever they buy the app it opens it with a plist entry or something? It doesn't seem very updated to me. Every time I come up with a new level, I will need to update the application.
So what I don't understand then is how I package the level and load it as a separate object that can be accessed in-game? Will the layer just be some kind of XML with images in a zip folder or something else? How is the level added to the game? What are the best practices for this type of thing?
I sorted it out and didn't find ANYTHING about this. I am a little confused about this concept and any help would be appreciated. I'm not looking for someone to write a game for me, I just need to point in the right direction so that I can develop it myself.
source to share
The level of your game is what you want; you are a designer after all.
You should look at the documentation NSBundle
, which may include property lists, image resources (etc.), and additional code. Package your package (zip handy), download asynchronously with NSURLConnection
and set NSDocuments directory check for packages and download with NSBundle
.
Or, for a simple game level using existing assets, just load the layer 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.
source to share
I would read the Programming Guide when purchasing apps . He has all the information he needs.
In short: the user completes an in-app purchase and receives a digital receipt from Apple. Your iPhone app must then contact your server to download the new levels, using the receipt as proof of purchase .
If you don't have a server to distribute your levels, you may want to consider a third party service like UrbanAirship .
source to share