So I'm working on a game and I'm trying to make a Level Selector right now. However I only want players to be able to play on levels that they've beaten. So I have a .js file labeled "ELD.js" and it contains:
var Levels = 0;
I don't really care how(in aspects of programing type). But I want to be able to change the "Levels" data value every time I win a level. Each level has it's own individual html file and all of the level files are in the same file as the "ELD.js" file.
I've looked for an answer to this but none of them seem to match what I need.
And while I'm on this subject (correct me if I'm wrong) but I can simply test for the "Levels" data value using this right?
<script type="text/javascript" src="ELD.js"></script>
<script>
if(Levels =< X)
{
}
</script>
X simply stands for an undefined number that I will choose later.
ELD.jsfile for every player. You should use a database instead to keep track of each users progress.