diff --git a/web/js/basicbullet.js b/web/js/basicbullet.js index e747d8f..3c47d4a 100644 --- a/web/js/basicbullet.js +++ b/web/js/basicbullet.js @@ -9,9 +9,9 @@ class bullet { this.speed = speed; // Set the initial position of the projectile to the player's position - let projectile = createVector(shotPosX, shotPosY); - x = directionX; - y = directionY; + let projectile = createVector(this.x, this.y); + this.x = directionX; + this.y = directionY; // Calculate the initial direction direction = createVector(targetX - projectile.x, targetY - projectile.y);