How do I save the progress

0 favourites
  • 2 posts
From the Asset Store
Progress\Loading Bar
$2.40 USD
40% off
Progress\Loading Bar. Now Load you game like a Professional.
  • Hi Yall,

    I have a quiz like system but i want all my questions to be shown only once.

    To do this i want to save it in a webstorage.

    Though i am not able to get this right with my current script.

    Can any one help me out? The script itself works perfectly and i get random questions every time.

    The thing is that i really want to only show them once and after that never again.

    The script:

    The way it fetches the questions ( from txt file ):

    This is a question;
    Answer1;
    Answer2;
    Answer3;
    Answer4;
    Answer2;
    1;
    |
    This is a question;
    Answer1;
    Answer2;
    Answer3;
    Answer4;
    Answer2;
    2;
    [/code:2fd3xnan]
    
    This way it takes line 1 as question, line 2,3,4,5 as answers you can give and line 6 as correct answer.
    
    I tried to save them on level, which is line 7 i added.
    
    Line 6 will be stored in the global variable currentNumber. Though i think i might mess up webstoragewise with the incorrect order of calling my functions.
    
    Any 1 here who can lighten me up?
    
    Thanks in advance!
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok so i was thinking.

    I am not very good with Arrays but i think the next thing in my mind could fix my problem.

    Is there a way to check if a specific value is written into the array and if that matches the webstorage to delete it from the array?

    In my webstorage i will save: level1,level2 etc.

    In my questions file i will set the 6th line to level1,level2 etc.

    So if i'm right in my Array there will be all level values ( the 6th line ).

    Am i correct? And if yes could any 1 help me further with that technique? I know the logic behind it but i'm really not sure how to make it working.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)