- From the MENU, a level can be loaded only if it's unlocked.
Let's clear this with an example:
Suppose that my game have 5 levels. When my character collides with the end sprite at the end of a level, it makes the current level state to 'completed' and 'unlock' the next one which becomes available from the 'MENU' layout. (ex: complete LV0 makes LV1 available from the MENU layout).
The problem is each time the player collides with an end sprite, the value of 'current.level' add 1.
As an example, if I replay the LV0 5x times, all levels are unlocked in a row, but the player haven't completed the Level_1, 2, 3 and 4!They are supposed to be locked.
- Complete a level to unlock the next one (becomes unlock from the MENU layout.
------------------------------------------------------------
- A button ?continue? load the last unlocked level.
Let's forget about this one... :)
Thanks for your help, I'll take a look at the button stuff.
Just ask again if it's unclear :)