xxxxxxxxxx
26
class Thingy {
constructor(x, y, col) {
this.x = x;
this.y = y;
this.col = col;
}
move() {
this.x += random(-1, 1)
}
show() {
stroke(255);
strokeWeight(3);
// eye
fill(this.col);
ellipse(this.x, this.y, 20, 20);
// mouth
line(this.x - 30, this.y + 30, this.x + 30, this.y + 30);
ellipse(this.x, this.y + 30, 50, 25);
}
}