Remove unused function
This commit is contained in:
@@ -523,26 +523,6 @@ function fireBullet(position, degrees) {
|
||||
setTimeout(() => appended.classList.add('fade'), 1000);
|
||||
}
|
||||
|
||||
function updateBullets(elapsed) {
|
||||
const deleteCount = 1;
|
||||
|
||||
[...bullets].forEach((bullet, index) => {
|
||||
bullet.time -= elapsed;
|
||||
const x = bullet.x + 0.001 * elapsed * bullet.vx;
|
||||
const y = bullet.y + 0.001 * elapsed * bullet.vy;
|
||||
bulletPt.x = x;
|
||||
bulletPt.y = y;
|
||||
|
||||
if (bullet.time > 0 && ![...wallElements].some(w => w.isPointInFill(bulletPt))) {
|
||||
[bullet.x, bullet.y] = wrapPos(x, y);
|
||||
bullet.node.style.transform = `translate(${bullet.x}px, ${bullet.y}px)`;
|
||||
} else {
|
||||
bullet.node.remove();
|
||||
bullets.splice(index, deleteCount);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function perpIntxn(baseSlope, xa, ya, xc, yc) {
|
||||
let isx, isy;
|
||||
|
||||
@@ -962,16 +942,6 @@ function animate(timestamp) {
|
||||
}
|
||||
|
||||
updateShip(s, elapsed);
|
||||
// updateBullets(elapsed);
|
||||
// console.log(bulletsContainer.children)
|
||||
// console.log([...bulletsContainer.children].filter(b => !b.classList.contains('fade')));
|
||||
// const a = [...bulletsContainer.children].filter(b => !b.classList.contains('fade')).forEach(b => b.classList.add('fade'));
|
||||
// console.log(bulletsContainer.children);
|
||||
// console.log('before', bulletsContainer.children);
|
||||
// const a = [...bulletsContainer.children].filter(b => !b.classList.contains('fade'));
|
||||
// const a = [...bulletsContainer.children].filter(b => !b.classList.contains('fade'));
|
||||
// a.forEach(b => b.classList.add('fade'))
|
||||
// console.log('after', bulletsContainer.children);
|
||||
|
||||
// updateEdges(position);
|
||||
if (drawCollisionLines) updateTriangles(position);
|
||||
|
||||
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 34 KiB |
Reference in New Issue
Block a user