diff --git a/web/js/basicbullet.js b/web/js/basicbullet.js index ba46912..6ed8b16 100644 --- a/web/js/basicbullet.js +++ b/web/js/basicbullet.js @@ -32,7 +32,7 @@ class bullet { pop(); } - update(targetx, targety, hasMoved) { + update(targetx, targety, hasMoved, radius) { // keeps the projetile updated so hit collision can be checked this.targetx = targetx; this.targety = targety; @@ -43,7 +43,7 @@ class bullet { let shot = true; let travelled = false; // check if the projectile has hit the player - if (dist(this.projectile.x, this.projectile.y, this.targetx, this.targety) <= this.radius) { + if (dist(this.projectile.x, this.projectile.y, this.targetx, this.targety) <= this.radius + radius) { hit = true; shot = false; // if the projectile has hit the player and the player has lives left, remove a life