Lashtw commited on
Commit
dc9ab84
·
verified ·
1 Parent(s): b96428a

Upload 41 files

Browse files
Files changed (3) hide show
  1. kingdom_map.html +2 -3
  2. prologue.html +2 -3
  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="bgm.mp3" type="audio/mpeg">
201
  </audio>
202
 
203
  <div class="game-container">
@@ -263,8 +263,7 @@
263
 
264
  <!-- 音樂來源註記 -->
265
  <div class="music-credit">
266
- <p>背景音樂:샛별 - Level Up</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="bgm.mp3" type="audio/mpeg">
13
  </audio>
14
 
15
  <div class="game-container">
@@ -33,8 +33,7 @@
33
 
34
  <!-- 音樂來源註記 -->
35
  <div class="music-credit">
36
- <p>背景音樂:샛별 - Level Up</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
- alert('讀取進度功能尚未實現');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('找不到讀取進度按鈕');