xxxxxxxxxx
47
// had to put settings as an array instead of string because it would generate blanks sometimes for no apparent reason
let settings = ["into the night", "under the rain","over the hill", "amongst the stars", "into buckingham palace", "into the ocean", "into the snow", "under the moon", "through skid row", "into the police station and said ACAB", "through central park", "into the metaverse", "through the quantum realm", "through hogwarts", "into a bar", "into the outlook hotel",
];
function preload() {
helveticaFont = loadFont("Helvetica-Bold-Font.ttf"); // downloaded font from online
// loads text files as strings
adjectives = loadStrings("english-adjectives.txt");
nouns = loadStrings("english-nouns.txt");
verbs = loadStrings("english-verbs.txt");
// background i uploaded
gradient1 = loadImage("gradient1.png");
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(gradient1);
// loop to generate random stars on the bottom portion of canvas
for (let i = 55; i < 250; i++) { fill(200, 150); // color of stars and transparency
noStroke();
circle(random(400), random(251, 400), random(1, 2)); }
// 'the' 'adjective' 'noun' 'verb' 'setting'
fill(255);
textFont(helveticaFont, 20); // (font name, font size)
text("the", 25, 124); // ('text', x, y)
text(random(adjectives), 25, 144); // generates random adjective to be plotted at (25, 144)
text(random(nouns), 25, 164);
text(random(verbs), 25, 184);
text(random(settings), 25, 204);
// stops it from uncontrallably changing frames
noLoop();
}
// only changes the sentence structure when you click on the canvas
function mousePressed() {
draw();
}