xxxxxxxxxx
31
let num =30;
let nums = [100,25,46,60];
let word=["rainbow","mask","dalila","friend","visual"]
let index=0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
ellipse(100,200,nums[2],nums[2]);
ellipse(200,200,num,num);
textSize(30);
text(word[index],10,100);
text(word[0],10,150);
}
function mousePressed(){
index=index+1;
// if (index==4){ //if index equals 4, reset it back to 0.
// index=0;
// }
//or
if(index==word.length){
index=0;
}
}