From 153d629bd9db3f5f0972f5181642ca53808d8747 Mon Sep 17 00:00:00 2001 From: Elijah Lucian Date: Sun, 2 May 2021 21:21:24 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webclient/src/spaceport/Laser.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/webclient/src/spaceport/Laser.js b/webclient/src/spaceport/Laser.js index c7c7382..286869e 100644 --- a/webclient/src/spaceport/Laser.js +++ b/webclient/src/spaceport/Laser.js @@ -4,8 +4,8 @@ const LASER_SIZE = 0.5; const BULLET_SPREAD = 0.1; const geometry = new THREE.BoxGeometry( - LASER_SIZE * 0.3, - LASER_SIZE * 0.3, + LASER_SIZE * 0.03, + LASER_SIZE * 0.03, LASER_SIZE ); @@ -24,16 +24,18 @@ export class Laser { const position = new THREE.Vector3(); this.direction = ship.direction; this.kill = false; - this.life = 20; + this.life = 10; this.stepX = (Math.random() - 0.5) * BULLET_SPREAD; this.stepY = (Math.random() - 0.5) * BULLET_SPREAD; ship.mesh.getWorldPosition(position); - this.mesh = new THREE.InstancedMesh(geometry, badLaserMat, count); - - this.mesh.instanceMatrix.setUsage(THREE.DynamicDrawUsage); + this.mesh = new THREE.Mesh( + geometry, + ship.direction > 0 ? goodLaserMat : badLaserMat, + count + ); this.mesh.position.set(position.x, position.y, position.z); }