I am designing a game with multiple levels, each level on a certain layout. What I want is if a user passed a certain number of levels (e.x passed level 3), I want to load the next level for him when he reopen the game (in our case level 4).
I tried using localStorage and this is a snapshot of my event sheet:
(to be clear we are now on a home layout (layout 2) which is nothing there just click on the mouse to start playing.)
what I am doing in this event sheet is I check if the key (levelReched) is not in the storage, if it is not there add it and assign "1" to it.
in the next event if (levelReached) is there, get it.
Now if the mouse clicked and (levelReached) value = "1" , got to first level (layout 3).
and the same for the other levels.
But the problem is that when I click the mouse nothing happens!! it does not go to any layout, it is still on home layout (layout 2).
I really appreciate any help from you guys.