Well.... levelsFinished =0; wouldnt suffice i think
Let me explain.
So i have a menuselect Screen where I draw all 7 levels as a pictogram on screen and the player can select one.
Once a level is finished the screen switches back to the menuSelect screen and depending on which LEVELFINISHED boolean is set to true, it draws a checkmark over the level Pictogram, so the player:
1. sees which level(s) he has finished
2. can't select the level anymore.
The levels don't need to be selected in chronological order.
So if the player wants to play lvl3 first and then 1 and after 6, etc. He/She can.
You say that
If you ever have lots of bits of code that do more or less the same thing, that's not good.
which sound very plausible, but in this case i don't see what else i can do to set a bit to true or false in order to check for checkmark-draw and whether or not the level can be played