xxxxxxxxxx
21
class Plate {
constructor (x, w) {
this.x = x;
this.w = w;
this.h = 50;
this.y = height - this.h;
}
show() {
rectMode(CENTER);
rect(this.x, this.y, this.w, this.h)
}
catches(pie) {
if (pie.y >= this.y && pie.x > this.x-this.w/2 && pie.y > this.y-this.w/2) {
return true;
} else {
return false;
}
}
}