开发者

Determine if Game has been Launched for the First Time - Cocos2d

I know this is probably very easy, but I wan开发者_高级运维t to add sprites in game that tell you have to play the game ONLY on the first launch. If the game is launched a second, third fourth, fifth, time etc. I do not want those instructions to appear again.

Could someone lead me in the right direction or give me an example?

I was thinking of adding a boolean "isFirstLaunch" then putting it in AppDelegate in "applicationDidFinishLaunching" then checking it in my game scene to see if it is true, but I'm not completely sure.

Any help?

Thanks!


Just use the default preferences. If the app doesn't find the file = first time, if the app does find the file = not first time. I did something like this when I was programming LustCalc. Look for NSUserDefaults... something. Sorry I did this a long time ago.


Found this: Best way to check if an iPhone app is running for the first time

as a side note, if you don't use synchronize, the iphone decide when to store the preferences, usally after a minute or two: if the app quits in the meantime, no preferences get saved. So you should sync only when you quit the app and at exceptional times.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜