xxxxxxxxxx
39
class folk {
constructor ( tempX, tempY, eyeColor,outY = random (-1,1),outX=random(-1,1),easing1 = random(0.1,0.2) ) {
this.x = 1;
this.y = 1;
this.outY = outY;
this.outX = outX;
this.easing1 = easing1;
this.eyeColor = eyeColor;
}
display() {
this.tempX = mouseX;
this.tempY = mouseY;
this.eyeColor = 200;
this.dx = this.tempX - this.x;
this.dy = this.tempY -this.y;
this.x += (this.dx) * this.easing1 + this.outX;
this.y += (this.dy) * this.easing1 + this.outY;
fill(200,0,0);
ellipse(this.x, this.y,12,12);
ellipse(this.x, this.y+12,15,20);
fill(this.eyeColor,0,0);
ellipse(this.x+3, this.y,2,3);
ellipse(this.x-3, this.y,4,4);
}
}