about summary refs log tree commit diff stats
path: root/html
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-10-27 15:53:33 -0400
committerelioat <elioat@tilde.institute>2024-10-27 15:53:33 -0400
commitec68b6184887cda6c3d11be57647c281db3926db (patch)
tree7f6537461597031e67cd7727ce4dae92463b2e97 /html
parent295ff18ed67628b20fa0664deb32487a21dab5ad (diff)
downloadtour-ec68b6184887cda6c3d11be57647c281db3926db.tar.gz
*
Diffstat (limited to 'html')
-rw-r--r--html/broughlike/index.html33
1 files changed, 27 insertions, 6 deletions
diff --git a/html/broughlike/index.html b/html/broughlike/index.html
index e86e022..46e3732 100644
--- a/html/broughlike/index.html
+++ b/html/broughlike/index.html
@@ -45,7 +45,7 @@
             padding: 0 0.5em;
             background-color: #f0f0f0;
         }
-        .toggleShake {
+        .toggleButton {
             padding: 0.75em;
             margin: 0.5em;
         }
@@ -54,7 +54,10 @@
 <body>
     <div class="header">
         <p><a href="about.html">About</a></p>
-        <button class="toggleShake" id="toggleShake" onclick="toggleShake()">Turn Shake Off</button>
+        <div>
+            <button class="toggleButton" id="toggleShake" onclick="toggleShake()">Turn Shake Off</button>
+            <!-- <button class="toggleButton" id="toggleHardMode" onclick="toggleHardMode()">Hard Mode On</button> -->
+        </div>
     </div>
     <canvas id="gameCanvas"></canvas>
     <script>
@@ -73,18 +76,32 @@
             combatDotBoss: '#b70030'
         };
 
-        const GRID_SIZE = 6;
+        // let hardMode = localStorage.getItem('hardMode') || false;
+        let hardModeModifier = 0;
+        // const toggleHardMode = () => {
+        //     hardMode = !hardMode;
+        //     localStorage.setItem('hardMode', hardMode);
+        //     document.getElementById('toggleHardMode').textContent = hardMode ? 'Hard Mode Off' : 'Hard Mode On';
+        //     if (hardMode) {
+        //         hardModeModifier = 10;
+        //     } else {
+        //         hardModeModifier = 0;
+        //     }
+        //     resetGame();
+        // };
+
+        const GRID_SIZE = 6 + hardModeModifier;
         const PLAYER_HEALTH = 12;
         const PLAYER_MAX_HEALTH = 16;
         const PLAYER_BASE_DAMAGE = 1;
-        const ENEMY_CHASE_DISTANCE = 4;
+        const ENEMY_CHASE_DISTANCE = 4 + hardModeModifier;
         const ENEMY_BOSS_OCCURRENCE = 10;
         const MIN_ENEMIES_ON_LEVEL = 1;
-        const MAX_ENEMIES_ON_LEVEL = 4;
+        const MAX_ENEMIES_ON_LEVEL = 4 + hardModeModifier;
         const MAX_ENEMY_HEALTH = 7;
         const MIN_ENEMY_HEALTH = 2;
         const WALLS_MIN = 5;
-        const WALLS_MAX = 20;
+        const WALLS_MAX = 20 + hardModeModifier;
         const ITEMS_MIN = 1;
         const ITEMS_MAX = 3;
         const DOTS_PER_HIT = 7;
@@ -725,6 +742,10 @@
         }
 
         function resetGame() {
+            const canvas = document.getElementById('gameCanvas');
+            if (canvas.classList.contains('shake')) {
+                canvas.classList.remove('shake');
+            }
             player.health = PLAYER_HEALTH;
             player.damage = PLAYER_BASE_DAMAGE;
             player.bonusDamageTurns = 0;