xxxxxxxxxx
27
var cricket, spider, beetle;
function setup(){
createCanvas(500,500);
noStroke();
cricket = new Bug(300, 50, color(30,240, 70));
spider = new Bug(300,270,color(20,30,40));
}
function draw(){
cricket.drawBug();
spider.drawBug();
}
class Bug {
constructor(tempX, tempY, bugColor) {
this.x = tempX;
this.y = tempY;
this.c = bugColor;
}
drawBug(){
fill(this.c);
ellipse(this.x,this.y,20,20);
}
}