xxxxxxxxxx
25
var prob = 0;
var x,y;
function setup() {
createCanvas(400, 400);
x = width/2;
y = height/2;
}
function draw() {
background(220);
ellipse(x,y,40,40);
prob = random(0,8); //(0,8) is a high enough number to make sure the cats move sporadically instead of every animation frame. try changin 8 to different numbers and see what happens
if(prob<0.25){
x+=10;
} else if(prob<0.50){
x-=10;
} else if(prob<0.75){
y+=10;
} else if(prob<1){
y-=10;
}
x=constrain(x,0,width);
y=constrain(y,0,width);
}