Spaces:
Running
Running
cutechicken
commited on
Commit
โข
1506433
1
Parent(s):
3bf28e4
Update game.js
Browse files
game.js
CHANGED
@@ -377,6 +377,7 @@ startReload() {
|
|
377 |
|
378 |
|
379 |
createBullet(scene) {
|
|
|
380 |
// ํฌํ ํฌ๊ธฐ ์ฆ๊ฐ
|
381 |
const bulletGeometry = new THREE.CylinderGeometry(0.2, 0.2, 2, 8);
|
382 |
const bulletMaterial = new THREE.MeshBasicMaterial({ color: 0xffd700 });
|
@@ -838,7 +839,7 @@ class Game {
|
|
838 |
// ๋ ๋๋ฌ ์ค์
|
839 |
this.renderer.shadowMap.enabled = true;
|
840 |
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
841 |
-
this.renderer.
|
842 |
|
843 |
// ๊ธฐ๋ณธ ์ฌ ์ค์
|
844 |
this.setupScene();
|
@@ -1168,15 +1169,15 @@ class Game {
|
|
1168 |
});
|
1169 |
|
1170 |
document.addEventListener('click', () => {
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
|
1181 |
document.addEventListener('pointerlockchange', () => {
|
1182 |
if (!document.pointerLockElement) {
|
|
|
377 |
|
378 |
|
379 |
createBullet(scene) {
|
380 |
+
if (!this.turret) return null; // ํฐ๋ ์ด ์์ผ๋ฉด null ๋ฐํ
|
381 |
// ํฌํ ํฌ๊ธฐ ์ฆ๊ฐ
|
382 |
const bulletGeometry = new THREE.CylinderGeometry(0.2, 0.2, 2, 8);
|
383 |
const bulletMaterial = new THREE.MeshBasicMaterial({ color: 0xffd700 });
|
|
|
839 |
// ๋ ๋๋ฌ ์ค์
|
840 |
this.renderer.shadowMap.enabled = true;
|
841 |
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
842 |
+
this.renderer.outputColorSpace = THREE.SRGBColorSpace;
|
843 |
|
844 |
// ๊ธฐ๋ณธ ์ฌ ์ค์
|
845 |
this.setupScene();
|
|
|
1169 |
});
|
1170 |
|
1171 |
document.addEventListener('click', () => {
|
1172 |
+
if (!document.pointerLockElement) {
|
1173 |
+
document.body.requestPointerLock();
|
1174 |
+
} else if (!this.isGameOver && this.tank && this.tank.isLoaded) {
|
1175 |
+
const bullet = this.tank.shoot(this.scene);
|
1176 |
+
if (bullet) {
|
1177 |
+
// Shooting effects...
|
1178 |
+
}
|
1179 |
+
}
|
1180 |
+
});
|
1181 |
|
1182 |
document.addEventListener('pointerlockchange', () => {
|
1183 |
if (!document.pointerLockElement) {
|