Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Code4Community/jewel-thief
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-242 committed Apr 15, 2024
2 parents c852e6e + ddd1622 commit 80655ae
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ var toggleVal = false;
var toggle = document.querySelector('input[type="checkbox"]');
toggle.addEventListener('click', () => {
toggleVal = !toggleVal;
for (i = 0; i < 5; i++) {
if (toggleVal == false) {
if (finishedLevels[i] == 1) {
document.getElementById("level-select").options[i+1].disabled = false;
} else {
document.getElementById("level-select").options[i+1].disabled = true;
}
} else {
document.getElementById("level-select").options[i+1].disabled = false;
}

}
});


Expand Down Expand Up @@ -193,7 +205,6 @@ function update() {
NextLevelMsg = this.physics.add.staticGroup();
NextLevelMsg.create(515, CENTER_VERTICAL-120, "NextLevel").setScale(.55);
}


player.setVelocity(0, 0);
reachedTarget = true;
Expand Down Expand Up @@ -319,8 +330,8 @@ function collectJewel(player, jewel) {
finishedLevels[current_level] = 1;
if (current_level < 5) {
document.getElementById("level-select").options[current_level+1].disabled = false;
document.getElementById("nextLevel").disabled = false;
}
document.getElementById("nextLevel").disabled = false;

}

Expand Down

0 comments on commit 80655ae

Please sign in to comment.