Last active
September 10, 2018 05:31
-
-
Save kmicheli/1fb156077271cfd645cda8103245b37e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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