renamed variables

This commit is contained in:
sam
2023-11-28 15:44:55 +01:00
parent fa41b78969
commit c31bd7f95b

View File

@@ -9,9 +9,9 @@ class bullet {
this.speed = speed; this.speed = speed;
// Set the initial position of the projectile to the player's position // Set the initial position of the projectile to the player's position
let projectile = createVector(shotPosX, shotPosY); let projectile = createVector(this.x, this.y);
x = directionX; this.x = directionX;
y = directionY; this.y = directionY;
// Calculate the initial direction // Calculate the initial direction
direction = createVector(targetX - projectile.x, targetY - projectile.y); direction = createVector(targetX - projectile.x, targetY - projectile.y);