xxxxxxxxxx
26
var bubble ={
x:100,
y:200,
display: function(){
ellipse(this.x, this.y, 20,20);
},
move: function(){
this.x = this.x + random(-1,1);
this.y = this.y + random(-1,1);
},
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
bubble.display();
bubble.move();
}