From 86325fcfa338f56f6627c89272016af37a3287e1 Mon Sep 17 00:00:00 2001 From: Wiwi Kuan Date: Fri, 9 Aug 2024 21:37:43 +0800 Subject: [PATCH] Add hide button, various updates. --- index.html | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 151417e..483bf41 100644 --- a/index.html +++ b/index.html @@ -128,7 +128,7 @@ statusString += ''; if (x === playerPosition.x && y === playerPosition.y) { - statusString += '📍'; + statusString += '🤣'; } else { const cell = grid[x][y]; if (cell.isRevealed) { @@ -307,10 +307,10 @@ var newElement = document.createElement("p"); if (win) { playSound('gameOverWin'); - newElement.innerHTML = "過關了!花費時間:" + timeString + "。要再玩一次的話,請重新整理網頁。"; + newElement.innerHTML = "過關了!花費時間:" + timeString + "。
要再玩一次的話,請重新整理網頁。
"; } else { playSound('gameOverLose'); - newElement.innerHTML = "你被炸死了!花費時間:" + timeString + "。要再玩一次的話,請重新整理網頁。"; + newElement.innerHTML = "你被炸死了!花費時間:" + timeString + "。
要再玩一次的話,請重新整理網頁。
"; } document.body.appendChild(newElement); } @@ -437,10 +437,27 @@ let startTime = Date.now(); // 記錄遊戲啟動的時間。 // printGrid(grid); // 作弊 + function toggleVisibility() { + var tutorial = document.getElementById('tutorial'); + var title = document.querySelector('h3'); + var button = document.getElementById('toggleButton'); + + if (tutorial.style.display !== 'none') { + tutorial.style.display = 'none'; + title.style.display = 'none'; + button.textContent = '顯示'; + } else { + tutorial.style.display = 'block'; + title.style.display = 'block'; + button.textContent = '隱藏'; + } + }; + +

NiceMine 好雷 by NiceChord 好和弦

你被丟到一個 8x8 的遊戲區域裡的某處,裡面總共有 12 個地雷。你的目標是標示出全部的地雷,或是翻開全部沒有地雷的格子。

@@ -449,7 +466,7 @@

聲音反饋:

-

+

\ No newline at end of file