I am making multi-level platformer game. Now I have add two scenes scene1 and scene2 ( scene3 is not added in the code, so leave that aside).
First the player have complete the scene1. Then only scene2 will unlock.
*locked/unlocked scene code is perfectly working.
Main Scene Working:-
In “Main” Scene, we have two objects name scene1 and scene2.
Scene1 and scene2 have two object variables locked and completed. For scene1, locked=0 ; completed=0. For scene2, locked=1; completed=0.
When player completes scene1, values of objects variables of scene1 updates: locked=0, completed=1.
Now global variable scene1completed=0(initials) updates to scene1completed=1.
This value of global variable I want to save (means games autosave when this occur). And when game starts first it check previously saved value of scene1completed.
Noted:- the game is for Android playstore.
Also,
global variable scene1completed is for scene1 completion.
global variable scene2completed is for scene2 completion.
… And so on multilevel scenes.