Skip to content

Instantly share code, notes, and snippets.

@kmicheli
Last active September 10, 2018 05:31
Show Gist options
  • Save kmicheli/1fb156077271cfd645cda8103245b37e to your computer and use it in GitHub Desktop.
Save kmicheli/1fb156077271cfd645cda8103245b37e to your computer and use it in GitHub Desktop.
var sourceWords = "inspired complicated wistful adventurous stern honest bubbly excited ambitious lost";
var words = sourceWords.split(" ");
var i = 0;
var r, g, b;
function setup() {
createCanvas(960,570);
noLoop();
}
function draw() {
background(0);
textSize(72);
textAlign(CENTER, CENTER);
}
function mousePressed() {
r = random(255);
g = random(255);
b = random(255);
fill(r, g, b, 150);
text(words[i], random(width), random(height));
i++;
if (i >= words.length){
i=0;
}
console.log(words[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment