Spaces:
Running
Running
cutechicken
commited on
Commit
โข
6a99267
1
Parent(s):
2ce947b
Update game.js
Browse files
game.js
CHANGED
@@ -547,7 +547,7 @@ class Game {
|
|
547 |
this.initialize();
|
548 |
}
|
549 |
|
550 |
-
|
551 |
try {
|
552 |
// ์๊ฐ ํจ๊ณผ ์ ๊ฑฐ
|
553 |
this.scene.fog = null;
|
@@ -571,31 +571,32 @@ class Game {
|
|
571 |
color: 0xD2B48C,
|
572 |
roughness: 0.8,
|
573 |
metalness: 0.2,
|
|
|
574 |
});
|
|
|
575 |
const ground = new THREE.Mesh(groundGeometry, groundMaterial);
|
576 |
ground.rotation.x = -Math.PI / 2;
|
577 |
ground.receiveShadow = true;
|
578 |
|
579 |
-
//
|
580 |
-
const
|
581 |
-
const
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
const height = Math.sin(x * baseFrequency) * Math.cos(z * baseFrequency) * heightScale;
|
587 |
-
vertices[i + 2] = height;
|
588 |
-
}
|
589 |
-
ground.geometry.attributes.position.needsUpdate = true;
|
590 |
-
ground.geometry.computeVertexNormals();
|
591 |
-
|
592 |
-
// EdgesGeometry๋ก ์ ์ถ๊ฐ
|
593 |
-
const edgesGeometry = new THREE.EdgesGeometry(ground.geometry);
|
594 |
-
const lineMaterial = new THREE.LineBasicMaterial({ color: 0x000000, linewidth: 1 });
|
595 |
-
const contourLines = new THREE.LineSegments(edgesGeometry, lineMaterial);
|
596 |
|
597 |
-
//
|
598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
this.scene.add(contourLines);
|
600 |
|
601 |
// ๋ ๋ค์ํ ์งํ ์์ฑ
|
@@ -669,7 +670,6 @@ class Game {
|
|
669 |
}
|
670 |
}
|
671 |
|
672 |
-
|
673 |
// ๋ ์ด๋ ์
๋ฐ์ดํธ ๋ฉ์๋ ์ถ๊ฐ
|
674 |
updateRadar() {
|
675 |
const currentTime = Date.now();
|
|
|
547 |
this.initialize();
|
548 |
}
|
549 |
|
550 |
+
async initialize() {
|
551 |
try {
|
552 |
// ์๊ฐ ํจ๊ณผ ์ ๊ฑฐ
|
553 |
this.scene.fog = null;
|
|
|
571 |
color: 0xD2B48C,
|
572 |
roughness: 0.8,
|
573 |
metalness: 0.2,
|
574 |
+
wireframe: false
|
575 |
});
|
576 |
+
|
577 |
const ground = new THREE.Mesh(groundGeometry, groundMaterial);
|
578 |
ground.rotation.x = -Math.PI / 2;
|
579 |
ground.receiveShadow = true;
|
580 |
|
581 |
+
// ๊ฒฉ์ ํจ๊ณผ๋ฅผ ์ํ ๋ผ์ธ ์ถ๊ฐ
|
582 |
+
const gridSize = 50; // ๊ฒฉ์ ํฌ๊ธฐ
|
583 |
+
const gridHelper = new THREE.GridHelper(MAP_SIZE, gridSize, 0x000000, 0x000000);
|
584 |
+
gridHelper.material.opacity = 0.1;
|
585 |
+
gridHelper.material.transparent = true;
|
586 |
+
gridHelper.position.y = 0.1; // ์ง๋ฉด๋ณด๋ค ์ฝ๊ฐ ์์ ๋ฐฐ์น
|
587 |
+
this.scene.add(gridHelper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
588 |
|
589 |
+
// ๋ฑ๊ณ ์ ํจ๊ณผ๋ฅผ ์ํ ์งํ ์ปจํฌ์ด
|
590 |
+
const contourLines = new THREE.LineSegments(
|
591 |
+
new THREE.EdgesGeometry(groundGeometry),
|
592 |
+
new THREE.LineBasicMaterial({
|
593 |
+
color: 0x000000,
|
594 |
+
opacity: 0.15,
|
595 |
+
transparent: true
|
596 |
+
})
|
597 |
+
);
|
598 |
+
contourLines.rotation.x = -Math.PI / 2;
|
599 |
+
contourLines.position.y = 0.1;
|
600 |
this.scene.add(contourLines);
|
601 |
|
602 |
// ๋ ๋ค์ํ ์งํ ์์ฑ
|
|
|
670 |
}
|
671 |
}
|
672 |
|
|
|
673 |
// ๋ ์ด๋ ์
๋ฐ์ดํธ ๋ฉ์๋ ์ถ๊ฐ
|
674 |
updateRadar() {
|
675 |
const currentTime = Date.now();
|