This commit is contained in:
Elijah Lucian 2021-05-02 21:23:45 -06:00
parent 153d629bd9
commit d1f5a0088d

View File

@ -54,8 +54,6 @@ export const scene = ({ ref }) => {
camera.lookAt(new THREE.Vector3(0, 0, 0)); camera.lookAt(new THREE.Vector3(0, 0, 0));
}); });
let boltCount = 0;
const animate = () => { const animate = () => {
const deltaTime = 0.075; const deltaTime = 0.075;
t += deltaTime; t += deltaTime;
@ -73,10 +71,8 @@ export const scene = ({ ref }) => {
ship.update({ deltaTime }); ship.update({ deltaTime });
if (ship.firing) { if (ship.firing) {
const bolt = new Laser(ship, boltCount + 1); const bolt = new Laser(ship);
boltCount += 1;
console.log('pew', boltCount);
bolts.push(bolt); bolts.push(bolt);
scene.add(bolt.mesh); scene.add(bolt.mesh);
ship.firing = false; ship.firing = false;
@ -91,7 +87,6 @@ export const scene = ({ ref }) => {
bolt.update({ deltaTime }); bolt.update({ deltaTime });
if (bolt.kill) { if (bolt.kill) {
boltCount -= 1;
scene.remove(bolt.mesh); scene.remove(bolt.mesh);
} }
} }