diff birthday_page/pages/index.html @ 39:6639f5389f47

[Amu Birthday] changed the logic and output when they lose.
author MrJuneJune <me@mrjunejune.com>
date Mon, 01 Dec 2025 20:37:22 -0800
parents 6c322f9c2cb9
children
line wrap: on
line diff
--- a/birthday_page/pages/index.html	Mon Dec 01 20:35:56 2025 -0800
+++ b/birthday_page/pages/index.html	Mon Dec 01 20:37:22 2025 -0800
@@ -7,7 +7,7 @@
       <link rel="preload" href="/random_1.jpeg" as="image">
       <link rel="preload" href="/random_2.png" as="image">
       <link rel="preload" href="/random_3.jpeg" as="image">
-      <title>Dino Birthday Game</title>
+      <title>Amu Birthday Game</title>
       <style>
           * {
               margin: 0;
@@ -134,6 +134,7 @@
               border-radius: 10px;
               cursor: pointer;
               font-weight: bold;
+              z-index: 1000;
               box-shadow: 0 5px 15px rgba(0,0,0,0.3);
           }
           
@@ -173,13 +174,13 @@
       </style>
   </head>
   <body>
+      <button id="startBtn">START GAME</button>
       <div id="gameContainer">
           <div id="ground"></div>
           <div id="dino"></div>
           <div id="goal"></div>
           <div id="score">Distance: 0m</div>
           <div id="message"></div>
-          <button id="startBtn">START GAME</button>
       </div>
   
       <script>
@@ -276,9 +277,8 @@
           
           function gameOver() {
               gameRunning = false;
-              messageEl.textContent = 'Game Over! Click START to try again';
+              messageEl.textContent = 'Game Over! YOU SUCK';
               messageEl.style.display = 'block';
-              startBtn.style.display = 'block';
               obstacles.forEach(obs => obs.remove());
               obstacles = [];
               goal.style.display = 'none';
@@ -342,14 +342,15 @@
               goal.style.display = 'none';
               
               let obstacleInterval = setInterval(() => {
-                if (!gameRunning || distance < gracePeriod) {
-                      clearInterval(obstacleInterval);
-                      return;
-                  }
+                if (!gameRunning) {
+                  clearInterval(obstacleInterval);
+                  return;
+                }
+                if (distance < gracePeriod) return; // just skip early
 
-                  if (Math.random() > 0.3) {
-                      createObstacle();
-                  }
+                if (Math.random() > 0.3) {
+                    createObstacle();
+                }
               }, 1500);
               
               gameLoop();