Removed homing bullets
This commit is contained in:
@@ -146,6 +146,8 @@ function shoot(directionX, directionY) {
|
||||
if (!projectile) {
|
||||
// Set the initial position of the projectile to the player's position
|
||||
projectile = createVector(500, 100);
|
||||
Xbuffer = directionX;
|
||||
Ybuffer = directionY;
|
||||
}
|
||||
|
||||
// Draw the small circle (projectile)
|
||||
@@ -153,7 +155,7 @@ function shoot(directionX, directionY) {
|
||||
circle(projectile.x, projectile.y, projSize);
|
||||
|
||||
// Move the projectile towards the movable circle
|
||||
let target = createVector(directionX, directionY);
|
||||
let target = createVector(Xbuffer, Ybuffer);
|
||||
let direction = target.copy().sub(projectile);
|
||||
direction.normalize();
|
||||
direction.mult(shotSpeed);
|
||||
@@ -184,6 +186,7 @@ function draw() {
|
||||
|
||||
if (shot == false) {
|
||||
shoot(playerPosX, playerPosY);
|
||||
|
||||
} else {
|
||||
shot = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user