From df80abcb79e94747b2c3ffef84f4b1add4940bd0 Mon Sep 17 00:00:00 2001 From: Samantha Date: Mon, 15 Apr 2024 19:14:42 -0400 Subject: [PATCH 1/2] next level doesnt appear on last level --- main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.js b/main.js index 6eff7e1..4440837 100644 --- a/main.js +++ b/main.js @@ -193,7 +193,6 @@ function update() { NextLevelMsg = this.physics.add.staticGroup(); NextLevelMsg.create(515, CENTER_VERTICAL-120, "NextLevel").setScale(.55); } - player.setVelocity(0, 0); reachedTarget = true; @@ -319,8 +318,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; } From ddd16221f81bce69e036f8cbd41bfc5c6463eb57 Mon Sep 17 00:00:00 2001 From: Samantha Date: Mon, 15 Apr 2024 19:31:03 -0400 Subject: [PATCH 2/2] easy mode now unlocks all levels --- main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.js b/main.js index 4440837..ff0f396 100644 --- a/main.js +++ b/main.js @@ -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; + } + + } });