 <p>What i would do is look at it in an Object Oriented Perspective, which is what Java is all about. When i get stuck on a piece of code then i write it down. Think of what the objective of the code is. </p> <ul> <li><p>You probably have a class called Level. In this level class you could have a property called "unlocked" or the opposite "locked". Then when the user goes to your "play a level" screen or what have you, then only allow the user to see the levels that are unlocked. </p></li> <li><p>You also probably have a Player class of some sort so you could have a property called "unlockedLevels" which is of the type Level[]. So then all of the unlocked levels would be in this array of Levels.</p></li> </ul> <p>It is all about how your code is structured, structure and true Object Orientation are the most important things in Java. When you stray from Object Oriented Design then you can run into problems that should never have existed.</p>