xxxxxxxxxx
40
let bubble;
function setup() {
createCanvas(600, 400);
bubble1 = new Bubble(200, 200, 40);
bubble2 = new Bubble(200, 200, 40);
bubble3 = new Bubble();
}
function draw(){
background(0)
bubble1.move();
bubble1.show();
bubble2.move();
bubble2.show();
}
class Bubble {
contructor() {
this.x = 5;
this.y = 5;
bubble.size = 50
}
move() {
this.x = this.x + (random(-5, 5));
this.y = this.y + (random(-5, 5));
}
show() {
stroke(255);
strokeWeight(4);
fill(255);
ellipse(5, 5, 45, 45);
}
}