0

I know this is probably very easy, but I want 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!

Jonathan
  • 2,623
  • 3
  • 23
  • 38
  • If I wanted to do this on a normal computer, I would add a profile file at a known location on startup (if the file isn't there, that would mean first time startup). I don't know if the iphone API allows the creation of files somewhere? – Orka May 15 '11 at 03:06
  • I'm not sure about that. It is a good idea though. – Jonathan May 15 '11 at 03:08

1 Answers1

1

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.

Community
  • 1
  • 1
gurghet
  • 7,591
  • 4
  • 36
  • 63