xxxxxxxxxx
34
let bubble;
function setup() {
createCanvas(600, 400);
bubble = new Bubble();
print(bubble.x, bubble.y)
}
function draw() {
background(0);
bubble.move();
bubble.show();
}
class Bubble {
constructor() {
this.x = 200;
this.y = 150;
}
move(){
this.x = this.x + noise(10);
this.y = this.y + noise(10);
}
show(){
stroke(255);
strokeWeight(4);
noFill();
ellipse(this.x, this.y, 24, 24);
}
}