Spaces:
Running
Running
Upload 41 files
Browse files- kingdom_map.html +2 -3
- prologue.html +2 -3
- script.js +16 -2
kingdom_map.html
CHANGED
|
@@ -197,7 +197,7 @@
|
|
| 197 |
<body class="home-page">
|
| 198 |
<!-- 音效元素 -->
|
| 199 |
<audio id="bgm" loop>
|
| 200 |
-
<source src="
|
| 201 |
</audio>
|
| 202 |
|
| 203 |
<div class="game-container">
|
|
@@ -263,8 +263,7 @@
|
|
| 263 |
|
| 264 |
<!-- 音樂來源註記 -->
|
| 265 |
<div class="music-credit">
|
| 266 |
-
<p>背景音樂:
|
| 267 |
-
<p>推廣:J&B無版權音樂庫 <a href="https://bit.ly/2YfWIhw" target="_blank">https://bit.ly/2YfWIhw</a></p>
|
| 268 |
<button id="toggle-bgm" class="small-btn">音樂開/關</button>
|
| 269 |
</div>
|
| 270 |
</div>
|
|
|
|
| 197 |
<body class="home-page">
|
| 198 |
<!-- 音效元素 -->
|
| 199 |
<audio id="bgm" loop>
|
| 200 |
+
<source src="Theme.mp3" type="audio/mpeg">
|
| 201 |
</audio>
|
| 202 |
|
| 203 |
<div class="game-container">
|
|
|
|
| 263 |
|
| 264 |
<!-- 音樂來源註記 -->
|
| 265 |
<div class="music-credit">
|
| 266 |
+
<p>背景音樂:由Suno製作</p>
|
|
|
|
| 267 |
<button id="toggle-bgm" class="small-btn">音樂開/關</button>
|
| 268 |
</div>
|
| 269 |
</div>
|
prologue.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<body class="prologue-page">
|
| 10 |
<!-- 音效元素 -->
|
| 11 |
<audio id="bgm" loop>
|
| 12 |
-
<source src="
|
| 13 |
</audio>
|
| 14 |
|
| 15 |
<div class="game-container">
|
|
@@ -33,8 +33,7 @@
|
|
| 33 |
|
| 34 |
<!-- 音樂來源註記 -->
|
| 35 |
<div class="music-credit">
|
| 36 |
-
<p>背景音樂:
|
| 37 |
-
<p>推廣:J&B無版權音樂庫 <a href="https://bit.ly/2YfWIhw" target="_blank">https://bit.ly/2YfWIhw</a></p>
|
| 38 |
<button id="toggle-bgm" class="small-btn">音樂開/關</button>
|
| 39 |
</div>
|
| 40 |
</div>
|
|
|
|
| 9 |
<body class="prologue-page">
|
| 10 |
<!-- 音效元素 -->
|
| 11 |
<audio id="bgm" loop>
|
| 12 |
+
<source src="Theme.mp3" type="audio/mpeg">
|
| 13 |
</audio>
|
| 14 |
|
| 15 |
<div class="game-container">
|
|
|
|
| 33 |
|
| 34 |
<!-- 音樂來源註記 -->
|
| 35 |
<div class="music-credit">
|
| 36 |
+
<p>背景音樂:由Suno製作</p>
|
|
|
|
| 37 |
<button id="toggle-bgm" class="small-btn">音樂開/關</button>
|
| 38 |
</div>
|
| 39 |
</div>
|
script.js
CHANGED
|
@@ -110,8 +110,22 @@ document.addEventListener('DOMContentLoaded', async function() {
|
|
| 110 |
if (loadGameBtn) {
|
| 111 |
loadGameBtn.addEventListener('click', function() {
|
| 112 |
console.log('點擊讀取進度按鈕');
|
| 113 |
-
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
});
|
| 116 |
} else {
|
| 117 |
console.error('找不到讀取進度按鈕');
|
|
|
|
| 110 |
if (loadGameBtn) {
|
| 111 |
loadGameBtn.addEventListener('click', function() {
|
| 112 |
console.log('點擊讀取進度按鈕');
|
| 113 |
+
|
| 114 |
+
// 檢查是否有當前玩家ID
|
| 115 |
+
const currentPlayerId = localStorage.getItem('currentPlayerId');
|
| 116 |
+
if (currentPlayerId) {
|
| 117 |
+
// 檢查是否有該玩家的存檔
|
| 118 |
+
const existingProgress = localStorage.getItem(`gameProgress_${currentPlayerId}`);
|
| 119 |
+
if (existingProgress) {
|
| 120 |
+
if (confirm(`發現玩家 ${currentPlayerId} 的存檔,是否載入進度?`)) {
|
| 121 |
+
window.location.href = 'kingdom_map.html';
|
| 122 |
+
}
|
| 123 |
+
} else {
|
| 124 |
+
alert(`玩家 ${currentPlayerId} 沒有存檔記錄`);
|
| 125 |
+
}
|
| 126 |
+
} else {
|
| 127 |
+
alert('請先開始遊戲或輸入玩家ID');
|
| 128 |
+
}
|
| 129 |
});
|
| 130 |
} else {
|
| 131 |
console.error('找不到讀取進度按鈕');
|