xxxxxxxxxx
25
class Box {
constructor(x, y, angle) {
this.x = x;
this.y = y;
this.angle = angle;
}
display(startingAngle) {
noStroke();
fill(255, 100);
push();
translate(this.x, this.y);
this.move(startingAngle);
box(size - size/4);
pop();
}
move(startingAngle) {
rotateX(startingAngle + this.angle);
// rotateY(startingAngle + this.angle);
// rotateZ(startingAngle + this.angle);
this.angle += 1;
}
}