xxxxxxxxxx
137
var standAlone = ["my god, I’m so lonely",
"are You sure it was nothing",
"You always want to watch",
"my dreams are all I have",
"anything I want to do is a good thing to do",
"lately, I’ve been hanging out on my bathroom floor",
"those people that say everything is great",
"am I crying? I don't care",
"You remind me of another time"
],
standAloneNext = [1, 3, 4];
var iStates = ["I've got terrible ideas",
"I'm not scared to die",
"I wanna be the one who kills the man",
"I won't leave the room",
"I always find a way to say the wrong things",
"I feel the need to go and waste it all",
"I feel like I’m someone else",
"I need the mask",
"I try to close my eyes",
"I’ll do anything that You want",
"I don’t wanna die",
"I often dream of You",
"I dream about it even when I wake up",
"I'll be better when we go outside again",
"I love it every time"
],
iNext = [2, 3, 4];
var ands = ["and I can't help myself",
"and I can't find out what You want",
"and I know that"
],
andsNext = [1, 2, 4];
var followers = [
"cause it made me feel like dying inside",
"that terrifies You",
"my god, I'm so lonely",
"the look on my face",
"that's just a lie",
"drive in circles, suburban spiral",
"no one's on my phone tonight"
],
followersNext = [1, 2];
var displayPoem = "Press the mouse to display a poem.";
var lines;
function setup() {
createCanvas(400, 400);
background('blue');
}
function draw() {
if (mouseIsPressed) {
lines = round(random(3, 5))
displayPoem = poemMaker(lines);
}
}
function mouseReleased() {
internet(displayPoem, lines)
return false;
}
function poemMaker(lines) {
var state = round(random(1, 2));
var poem = '';
//I=1,standAlone=2, and = 3,followers = 4
while (lines != 0) {
switch (state) {
case 1:
poem += random(iStates)
poem += '\n'
state = random(iNext)
break;
case 2:
poem += random(standAlone)
poem += '\n'
state = random(standAloneNext)
break;
case 3:
poem += random(ands)
poem += '\n'
state = random(andsNext)
break;
case 4:
poem += random(followers)
poem += '\n'
state = random(followersNext)
break;
}
lines--;
}
return poem;
}
function internet(poemIn, lines) {
var x = round(random(0, 400))
var y = round(random(0, 400))
var height = (lines * 20)
if ((x + textWidth(poemIn)) / 2 > 400) {
x -= (textWidth(poemIn)) / 5
}
if ((y + height) > 400) {
y -= (height - 25)
}
fill(220)
rect(x, y, textWidth(poemIn) / 2 + 20, 20)
fill('white')
rect(x, y + 20, textWidth(poemIn) / 2 + 20, height)
noStroke()
fill('red')
circle(x + 10, y + 10, 10)
fill('yellow')
circle(x + 25, y + 10, 10)
fill('green')
circle(x + 40, y + 10, 10)
noFill()
stroke(10)
textSize(12)
textAlign(LEFT)
text(poemIn, x + 7, y + 35)
}