0

I maka a mobile game for Android and I need tutorial for my game that appears only once when game installed and opened first time. Is there a nice way to do it? What to add in my code for this?

Ben Benson
  • 33
  • 3
  • You should use a shared preference which is checked at the start of your game. If isn't set you show the tutorial and set the (boolean) preference to true. http://stackoverflow.com/questions/7217578/check-if-application-is-on-its-first-run – Lucas Jun 29 '15 at 19:57
  • You're question is very broad. There are a whole lot of ways to do this. Essentially what you need to do save a boolean flag that indicates whether the user has completed the tutorial or not. You could use a `SharedObject`, save a file with the `File` & `FileStream` class, make a webservice or use a cloud service etc. Consider updating your question to be more specific and show what you've tried or explored so far. – BadFeelingAboutThis Jun 29 '15 at 23:31

1 Answers1

0

Probably the easiest way is to use a local SharedObject:

var so:SharedObject = SharedObject.getLocal("data");

// when the tutorial is completed:
so.data.tutorialCompleted = true;

// before the tutorial starts
if(so.data.tutorialCompleted == true){
    // skip tutorial
}else{
    // start tutorial
}
Aaron Beall
  • 49,769
  • 26
  • 85
  • 103