xxxxxxxxxx
48
var words = [ "friendship", "magic", "treehouse", "kitten"];
let cword = "start";
g = 90;
p = 0;
t = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(255);
p = sin(g)*255;
t = abs(p);
fill(0,t);
if(t<10){
cword = random(words);
}
textFont("Arial",32);
text(cword, 20, 200);
}
function mouseWheel() {
if (event.deltaY > 0) {
g = g + 0.1;
}
else {
g = g - 0.1;
}
}