HOW DO YOU SAVE??
lescobar94
Member Posts: 25
I'm currently working on a quiz game that asks you different questions on each scene. I managed to save the score so that every time you re-open the game, you start with the same amount of points you ended with the last time you played. I'm currently trying to find a way to save the question where you left of so that next time you open the game, you don't have to restart all of the questions to get to where you were before. Does anyone know how I could make this work?
Comments
On iOS I do not think you can work out when a person closes the App to save the attribute. Perhaps you could change and save the scene attribute each time you enter a new scene so it knows the last scene you are in. Again loading the saved attribute and telling the app to go to that scene.
Hope that makes some sense.
Once you have "saved attribute" have a "load attribute" command in the beginning of your game (first scene perhaps) then tell the game to go the scene that correlates with the saved attribute.
if attribute equals 1 go to scene 1
if attribute equals 2 go to scene 2
You could also make it only checks to see if the attribute is above zero so that you know a scene has been visited otherwise it would ignore the rule and continue as normal:
If attribute is => 2 then
if attribute equals 2 go to scene 2
if attribute equals 3 go to scene 3
otherwise
go to scene 1
if you are wanting to store that many values then you should use tables. Tables can store the answer values and also what scene a player is up to. It will be more efficient and easier for you.
I suggest you look up some tutorials on working with tables in the Cookbook or people's videos -they will tell you all you need to know to get started with a solution.
Change an attribute based on whichever scene you are in and make sure that attribute it written to a table cell value and saved. This is then the value you recall and test to see what scene you should be in/at.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left