xxxxxxxxxx
22
class cannon {
constructor(X, Y, R) {
this.x = X;
this.y = Y;
this.r = R;
this.rot = 0;
}
show() {
noStroke();
fill(100);
circle(this.x, this.y, this.r);
}
attack() {
this.rot = atan2(people[0].y - this.y,people[0].x - this.x)
this.x += cos(this.rot)
this.y += sin(this.rot)
//remember jeremy shafer!!!!!!!!
}
}