Right now you are saving a bunch of booleans, you have to get rid of those and just store an integer variable (let’s call it Unlocked Levels). On the comparisons you are doing on button click you just have to check if the variable Unlocked Levels is less or equal than the level number you are testing. When you unlock a new level you save Unlocked Levels with the level number.