added rewards for level completion

This commit is contained in:
landgreen
2020-09-09 05:47:17 -07:00
parent 8ce7f684c8
commit 1b522551ce
7 changed files with 20 additions and 12 deletions

View File

@@ -477,6 +477,7 @@ if (localSettings) {
difficultyMode: '1',
fpsCapDefault: 'max',
runCount: 0,
levelsClearedLastGame: 0
};
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
document.getElementById("community-maps").checked = localSettings.isCommunityMaps
@@ -617,6 +618,7 @@ document.getElementById("community-maps").addEventListener("input", () => {
document.getElementById("difficulty-select").addEventListener("input", () => {
game.difficultyMode = Number(document.getElementById("difficulty-select").value)
localSettings.difficultyMode = game.difficultyMode
localSettings.levelsClearedLastGame = 0 //after changing difficulty, reset run history
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
});