added return variables from class
This commit is contained in:
@@ -49,6 +49,8 @@ class bullet {
|
||||
this.targety = targety;
|
||||
this.projectile.add(p5.Vector.mult(this.direction, this.speed));
|
||||
|
||||
let hit = false;
|
||||
let shot = true;
|
||||
|
||||
if (dist(this.projectile.x, this.projectile.y, this.targetx, this.targety) <= this.radius) {
|
||||
hit = true;
|
||||
@@ -58,7 +60,8 @@ class bullet {
|
||||
bounceY = this.projectile.y;
|
||||
shot = false;
|
||||
}
|
||||
return { hit, shot };
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user