cutechicken commited on
Commit
3132a78
β€’
1 Parent(s): 57e9535

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +14 -15
game.js CHANGED
@@ -327,10 +327,10 @@ class Game {
327
  async initialize() {
328
  try {
329
  // μ•ˆκ°œ 효과 μ‘°μ •
330
- this.scene.fog = new THREE.Fog(0xC2B280, 1, 150); // 더 μžμ—°μŠ€λŸ¬μš΄ 사막색
331
  this.scene.background = new THREE.Color(0x87CEEB); // ν•˜λŠ˜μƒ‰ λ°°κ²½
332
 
333
- const ambientLight = new THREE.AmbientLight(0xffffff, 0.6); // μ£Όλ³€κ΄‘ κ°μ†Œ
334
  this.scene.add(ambientLight);
335
 
336
  const directionalLight = new THREE.DirectionalLight(0xffffff, 1.2); // νƒœμ–‘κ΄‘ κ°•ν™”
@@ -553,19 +553,18 @@ async addDesertDecorations() {
553
  const cameraHeight = 15;
554
  const lookAtHeight = 5;
555
 
556
- const tankRotation = this.tank.body.rotation.y;
557
-
558
- this.camera.position.set(
559
- tankPos.x - Math.sin(tankRotation) * cameraDistance,
560
- tankPos.y + cameraHeight,
561
- tankPos.z - Math.cos(tankRotation) * cameraDistance
562
- );
563
-
564
- const lookAtPoint = new THREE.Vector3(
565
- tankPos.x + Math.sin(tankRotation) * 10,
566
- tankPos.y + lookAtHeight,
567
- tankPos.z + Math.cos(tankRotation) * 10
568
- );
569
 
570
  this.camera.lookAt(lookAtPoint);
571
  }
 
327
  async initialize() {
328
  try {
329
  // μ•ˆκ°œ 효과 μ‘°μ •
330
+ this.scene.fog = new THREE.Fog(0xC2B280, 50, 250); // μ•ˆκ°œ μ‹œμž‘ 거리λ₯Ό 늘리고 λλ‚˜λŠ” 거리도 증가
331
  this.scene.background = new THREE.Color(0x87CEEB); // ν•˜λŠ˜μƒ‰ λ°°κ²½
332
 
333
+ const ambientLight = new THREE.AmbientLight(0xffffff, 1.0); // μ£Όλ³€κ΄‘ 강도 증가
334
  this.scene.add(ambientLight);
335
 
336
  const directionalLight = new THREE.DirectionalLight(0xffffff, 1.2); // νƒœμ–‘κ΄‘ κ°•ν™”
 
553
  const cameraHeight = 15;
554
  const lookAtHeight = 5;
555
 
556
+ const turretRotation = this.tank.turretGroup.rotation.y + this.tank.body.rotation.y;
557
+ this.camera.position.set(
558
+ tankPos.x - Math.sin(turretRotation) * cameraDistance,
559
+ tankPos.y + cameraHeight,
560
+ tankPos.z - Math.cos(turretRotation) * cameraDistance
561
+ );
562
+
563
+ const lookAtPoint = new THREE.Vector3(
564
+ tankPos.x + Math.sin(turretRotation) * 10,
565
+ tankPos.y + lookAtHeight,
566
+ tankPos.z + Math.cos(turretRotation) * 10
567
+ );
 
568
 
569
  this.camera.lookAt(lookAtPoint);
570
  }