diff --git a/map/domon/ge-mutest.js b/map/domon/ge-mutest.js
index c128f60..9142583 100644
--- a/map/domon/ge-mutest.js
+++ b/map/domon/ge-mutest.js
@@ -1,147 +1,154 @@
var mymap = L.map('mymap').setView([38.898913, 139.818540], 16);
-
-var gsiLayer = L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', {
- attribution: '国土地理院 (地理院タイル)'
-});
-
-var osmLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors'
-});
-
-gsiLayer.addTo(mymap);
-
-var baseMaps = {
- "国土地理院": gsiLayer,
- "OpenStreetMap": osmLayer
-};
-
-L.control.layers(baseMaps).addTo(mymap);
-
-var markers = [
- L.marker([38.899003, 139.818406]),
- L.marker([38.903117, 139.816343]),
- L.marker([38.902537, 139.820163]),
- L.marker([38.894325, 139.819551]),
- L.marker([38.904011, 139.818709])
-];
-
-var currentDestination = null;
-var visitedDestinations = new Set();
-var totalDestinations = markers.length;
-
-function setRandomDestination() {
- if (currentDestination) {
- mymap.removeLayer(currentDestination);
- }
- let availableMarkers = markers.filter(marker => !visitedDestinations.has(marker));
- if (availableMarkers.length === 0) {
- alert('おめでとうございます!全ての目的地を制覇しました!ゲームクリアです!');
- resetGame();
- return;
- }
- currentDestination = availableMarkers[Math.floor(Math.random() * availableMarkers.length)];
- currentDestination.addTo(mymap);
- document.getElementById('game-info').textContent = `新しい目的地が設定されました!目的地を探してクリックしてください。(${visitedDestinations.size + 1}/${totalDestinations})`;
-}
-
-markers.forEach(marker => {
- marker.on('click', function(e) {
- var clickedLat = e.latlng.lat.toFixed(6);
- var clickedLng = e.latlng.lng.toFixed(6);
- document.getElementById('game-info').textContent = `クリックした位置: (${clickedLat}, ${clickedLng})`;
- if (marker === currentDestination) {
- document.getElementById('janken-game').style.display = 'block';
- enableJankenButtons(true);
- document.getElementById('result').textContent = '';
- } else {
- document.getElementById('game-info').textContent += ' - この場所は目的地ではありません。';
- }
- L.DomEvent.stopPropagation(e);
- });
-});
-
-mymap.on('click', function(e) {
- if (e.originalEvent.target.nodeName !== 'IMG') {
- var clickedLat = e.latlng.lat.toFixed(6);
- var clickedLng = e.latlng.lng.toFixed(6);
- document.getElementById('game-info').textContent = `クリックした位置: (${clickedLat}, ${clickedLng})`;
- document.getElementById('janken-game').style.display = 'none';
- enableJankenButtons(false);
- }
-});
-
-function enableJankenButtons(enable) {
- const buttons = document.querySelectorAll('#janken-game button');
- buttons.forEach(button => {
- button.disabled = !enable;
- });
-}
-
-const choices = ['rock', 'paper', 'scissors'];
-choices.forEach(choice => {
- document.getElementById(choice).addEventListener('click', () => {
- playJanken(choice);
- enableJankenButtons(false);
- });
-});
-
-function playJanken(playerChoice) {
- const computerChoice = choices[Math.floor(Math.random() * 3)];
- const outcome = getOutcome(playerChoice, computerChoice);
- document.getElementById('result').textContent = `あなた: ${translateChoice(playerChoice)}, コンピュータ: ${translateChoice(computerChoice)}. ${outcome}`;
-
- if (outcome.includes('あなたの勝ち')) {
- visitedDestinations.add(currentDestination);
- if (visitedDestinations.size === totalDestinations) {
- setTimeout(() => {
+
+ var gsiLayer = L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', {
+ attribution: '国土地理院 (地理院タイル)'
+ });
+
+ var osmLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ attribution: '© OpenStreetMap contributors'
+ });
+
+ gsiLayer.addTo(mymap);
+
+ var baseMaps = {
+ "国土地理院": gsiLayer,
+ "OpenStreetMap": osmLayer
+ };
+
+ L.control.layers(baseMaps).addTo(mymap);
+
+ var markers = [
+ L.marker([38.899003, 139.818406]),
+ L.marker([38.903117, 139.816343]),
+ L.marker([38.902537, 139.820163]),
+ L.marker([38.894325, 139.819551]),
+ L.marker([38.904011, 139.818709])
+ ];
+
+ var currentDestination = null;
+ var visitedDestinations = new Set();
+ var totalDestinations = markers.length;
+
+ function setRandomDestination() {
+ if (currentDestination) {
+ mymap.removeLayer(currentDestination);
+ }
+ let availableMarkers = markers.filter(marker => !visitedDestinations.has(marker));
+ if (availableMarkers.length === 0) {
alert('おめでとうございます!全ての目的地を制覇しました!ゲームクリアです!');
resetGame();
- }, 2000);
- } else {
- setTimeout(() => {
- setRandomDestination();
- document.getElementById('janken-game').style.display = 'none';
- }, 2000);
+ return;
+ }
+ currentDestination = availableMarkers[Math.floor(Math.random() * availableMarkers.length)];
+ currentDestination.addTo(mymap);
+ document.getElementById('game-info').textContent = `新しい目的地が設定されました!目的地を探してクリックしてください。(${visitedDestinations.size + 1}/${totalDestinations})`;
}
- } else {
- setTimeout(() => {
+
+ markers.forEach(marker => {
+ marker.on('click', function(e) {
+ var clickedLat = e.latlng.lat.toFixed(6);
+ var clickedLng = e.latlng.lng.toFixed(6);
+ document.getElementById('game-info').textContent = `クリックした位置: (${clickedLat}, ${clickedLng})`;
+ if (marker === currentDestination) {
+ document.getElementById('janken-game').style.display = 'block';
+ enableJankenButtons(true);
+ document.getElementById('result').textContent = '';
+ } else {
+ document.getElementById('game-info').textContent += ' - この場所は目的地ではありません。';
+ }
+ L.DomEvent.stopPropagation(e);
+ });
+ });
+
+ mymap.on('click', function(e) {
+ if (e.originalEvent.target.nodeName !== 'IMG') {
+ var clickedLat = e.latlng.lat.toFixed(6);
+ var clickedLng = e.latlng.lng.toFixed(6);
+ document.getElementById('game-info').textContent = `クリックした位置: (${clickedLat}, ${clickedLng})`;
+ document.getElementById('janken-game').style.display = 'none';
+ enableJankenButtons(false);
+ }
+ });
+
+ function enableJankenButtons(enable) {
+ const buttons = document.querySelectorAll('#janken-game button');
+ buttons.forEach(button => {
+ button.disabled = !enable;
+ });
+ }
+
+ const choices = ['rock', 'paper', 'scissors'];
+ choices.forEach(choice => {
+ document.getElementById(choice).addEventListener('click', () => {
+ playJanken(choice);
+ enableJankenButtons(false);
+ });
+ });
+
+ function playJanken(playerChoice) {
+ const computerChoice = choices[Math.floor(Math.random() * 3)];
+ const outcome = getOutcome(playerChoice, computerChoice);
+ document.getElementById('result').textContent = `あなた: ${translateChoice(playerChoice)}, コンピュータ: ${translateChoice(computerChoice)}. ${outcome}`;
+
+ if (outcome.includes('あなたの勝ち')) {
+ visitedDestinations.add(currentDestination);
+ if (visitedDestinations.size === totalDestinations) {
+ setTimeout(() => {
+ alert('おめでとうございます!全ての目的地を制覇しました!ゲームクリアです!');
+ resetGame();
+ }, 2000);
+ } else {
+ setTimeout(() => {
+ setRandomDestination();
+ document.getElementById('janken-game').style.display = 'none';
+ }, 2000);
+ }
+ } else {
+ setTimeout(() => {
+ document.getElementById('janken-game').style.display = 'none';
+ }, 2000);
+ }
+ }
+
+ function getOutcome(player, computer) {
+ if (player === computer) return '引き分け!';
+ if (
+ (player === 'rock' && computer === 'scissors') ||
+ (player === 'paper' && computer === 'rock') ||
+ (player === 'scissors' && computer === 'paper')
+ ) {
+ return 'あなたの勝ち!おめでとう!🎉 2秒後に新しい目的地が設定されます。';
+ }
+
+ const losingMessages = [
+ 'コンピュータの勝ち!次の目的地に向かってください。',
+ '今回は負けちゃったね。次の目的地で頑張ろう!',
+ '負けは次への成長のチャンス!次の目的地に進もう!',
+ '今回は運が悪かった。次の目的地で挽回しよう!',
+ '負けても大丈夫。次の目的地でリベンジだ!'
+ ];
+
+ return losingMessages[Math.floor(Math.random() * losingMessages.length)];
+ }
+
+ function translateChoice(choice) {
+ const translations = { rock: 'グー', paper: 'パー', scissors: 'チョキ' };
+ return translations[choice];
+ }
+
+ document.getElementById('reset-button').addEventListener('click', resetJankenGame);
+
+ function resetJankenGame() {
+ document.getElementById('result').textContent = '';
+ enableJankenButtons(true);
+ }
+
+ function resetGame() {
+ visitedDestinations.clear();
+ setRandomDestination();
document.getElementById('janken-game').style.display = 'none';
- }, 2000);
- }
-}
-
-function getOutcome(player, computer) {
- if (player === computer) return '引き分け!';
- if (
- (player === 'rock' && computer === 'scissors') ||
- (player === 'paper' && computer === 'rock') ||
- (player === 'scissors' && computer === 'paper')
- ) {
- return 'あなたの勝ち!おめでとう!🎉 2秒後に新しい目的地が設定されます。';
- }
-
- const losingMessages = [
- 'コンピュータの勝ち!次の目的地に向かってください。',
- '今回は負けちゃったね。次の目的地で頑張ろう!',
- '負けは次への成長のチャンス!次の目的地に進もう!',
- '今回は運が悪かった。次の目的地で挽回しよう!',
- '負けても大丈夫。次の目的地でリベンジだ!'
- ];
-
- return losingMessages[Math.floor(Math.random() * losingMessages.length)];
-}
-
-function translateChoice(choice) {
- const translations = { rock: 'グー', paper: 'パー', scissors: 'チョキ' };
- return translations[choice];
-}
-
-function resetGame() {
- visitedDestinations.clear();
- setRandomDestination();
- document.getElementById('janken-game').style.display = 'none';
- document.getElementById('result').textContent = '';
-}
-
-// 初期化
-resetGame();
+ document.getElementById('result').textContent = '';
+ }
+
+ // 初期化
+ resetGame();