Revert "added former and current position"

This reverts commit 8afd36ba77
This commit is contained in:
2023-11-26 01:01:40 +01:00
parent 69d55b2b2a
commit 0dd3c4098b

View File

@@ -93,9 +93,8 @@ function shoot(directionX, directionY) {
circle(projectile.x, projectile.y, projSize); circle(projectile.x, projectile.y, projSize);
// Move the projectile towards the movable circle // Move the projectile towards the movable circle
let targetFormer = createVector(Xbuffer, Ybuffer); let target = createVector(Xbuffer, Ybuffer);
let target = createVector(directionX, directionY); let direction = target.copy().sub(projectile);
let direction = targetFormer.copy().sub(projectile);
direction.normalize(); direction.normalize();
direction.mult(shotSpeed); direction.mult(shotSpeed);
projectile.add(direction); projectile.add(direction);