HOW ! Gameplay guide on first time playing the game..?

Hi everyone … :smile:

Does anyone know what is the term called for gameplay guide on opening the game for the first time.
Me and my team wants to implement in our game that feature.

For instance -

suppose anyone starts the game for the first time…
it has a slider to push the crate to show force applied… we want an animation hand to show pointing that push the slider, so that the game is more easy for children
as we are implementing in a school…

and stuffs like that…
as i dont know the term and how to achieve it… ?
does anyone knows how to do it… ??

@slackmoehrle can you help about it. ??

Do you want things like a hand moving on some object and that object is moving which will help user how exactly he has to play game. Is it what you’re asking for?
If yes, then I don’t know whether there is some separate term other than ‘animation tutorial’. If this is what you want than it can be achieved by Actions on sprites. Change the speed accordingly in order to depict different force effect.

:stuck_out_tongue:

ah…!! no… :frowning:

actually it is quite similat to animation tutorial only…
ok… so how do i manage it, so that it appers only once.

i need to save the data or make a counter something like that to save that the tutorial will not repeat on the next start of the game

Just create a file in which write flag after closing the program.
If the flag is set to 1 after the run the program, then the program has already run.

could you explain a little in details please… ?

See, I would almost repeat what Te2Ra said.
I still have to learn how to read a file so I can’t give you the code. You may check this in Wiki.
But here is approach.
You actually have to read a flag value from the datafile as true or false or 1 or 0 -whatever you wish.
This thing you need not read just before the beginning of your animation tutorial but in the very beginning when you read data from the datafile. You must keep some flags(variables) which would have default value but if their values are present in dataFile then they should be overwritten and this value you must use throughout the game.

And ofcourse, since you want to keep the value same(which is false for not showing next time) after 1st time, so you need not write your dataFile again and again but your game code will have to check this thing again and again that whether it is 1st time or not

ok… thanks… :smile:

i will see, how it can be achieved… :smile:

You can use a file, UserDefaults or Sqlite to name a few options.

You just need a flag that is “tutorial complete” So ANY of the above can do this.

  1. Reading from a file, there are several ways to do this:
string STRING;
	ifstream infile;
	infile.open ("names.txt");
        while(!infile.eof) // To get you all the lines.
        {
	        getline(infile,STRING); // Saves the line in STRING.
	        cout<<STRING; // Prints our STRING.
        }
	infile.close();
  1. UserDefaults: http://www.cocos2d-x.org/reference/native-cpp/V3.0alpha0/db/d94/classcocos2d_1_1_user_default.html#details

  2. SQLite: A simple Tutorial How to use SQLite in cocos2d-x ……(Tutorial by YUYE)

2 Likes

bool showanimation=UserDefault::sharedUserDefault()->getBoolForKey(“firstTime”,true);

if(showanimation)
{
//show animation whatever you want to show for the first time
UserDefault::sharedUserDefault()->setBoolForKey(“firstTime”,false);
UserDefault::sharedUserDefault()->flush();
}