diff --git a/assets/script.js b/assets/script.js index 8795570..97ebe27 100644 --- a/assets/script.js +++ b/assets/script.js @@ -8,6 +8,18 @@ class Game { this.points = 0; this.totalMoves = 0; this.levelMoves = {}; + this.traditional = false; + } + + toggleTraditional() { + if (this.traditional) { + this.traditional = false; + } else { + this.traditional = true; + } + + this.mapInstance.traditional = this.traditional; + this.mapInstance.display(); } initializeLevel() { @@ -50,7 +62,7 @@ class Map { this.totalWin = g.level + 1 == levels.length; this.finalPointsGiven = false; - this.traditional = false; + this.traditional = g.traditional; } generateMapArray() {