xxxxxxxxxx
105
// This work uses Lana Del Rey's Poetry "LA Who am I to love you", as an entry point. As Lana utilized the orange tree as her album cover, it also resembels the city's symbol - orange scents under the sunshine. Therefore, there are a constant falling of words "LA", users have to catch it in its quick falling, as LA people catch their dreams. Once you catch all of them, the full poetry will appear on the screen.
let oranges = [];
let words = [
"LA",
"I'm from nowhere",
"who am I to love you?",
"I've got nothing",
"when I'm feeling this way",
"and I've got nothing to offer?",
"not quite the city that never sleeps",
"Not quite the city that wakes",
"but the city that dreams, for sure",
"If by dreams, you mean in nightmares",
"I'm a dreamer, but I'm from nowhere",
"who am I to dream?",
"I'm upset",
"I have complaints",
"listen to me",
"LA I know I'm bad",
"but I have nowhere else to go, can I come home now?",
"I never had a mother",
"will you let me make the sun my own for now",
"and the ocean my son?",
"And I love that you love the neon lights like me",
"Orange in the distance",
"We both love that",
"And I love that we have that in common",
];
let poem = "";
let selectedWordIndex = -1;
let bgImg;
function preload() {
bgImg = loadImage("lana.jpeg");
}
function setup() {
createCanvas(600, 500);
textAlign(CENTER);
textSize(30);
// create the oranges
for (let i = 0; i < 20; i++) {
let x = random(width);
let y = random(height);
let size = random(30, 50);
let speed = random(1, 5);
oranges.push({
x: x,
y: y,
size: size,
speed: speed,
});
}
// add the background voice
let audio = createAudio("lana audio.mp4");
audio.autoplay(true);
}
function draw() {
background(bgImg);
fill("white");
for (let i = 0; i < oranges.length; i++) {
let orange = oranges[i];
text("LA", orange.x, orange.y);
}
for (let i = 0; i < oranges.length; i++) {
let orange = oranges[i];
orange.y += orange.speed;
if (orange.y > height + orange.size) {
orange.y = -orange.size;
}
}
fill("orange");
textSize(20);
//textStyle(BOLD);
let lineHeight = textSize() * 1.2;
let y = height - (selectedWordIndex + 1) * lineHeight;
text(poem, width / 2, y);
}
function mousePressed() {
for (let i = 0; i < oranges.length; i++) {
let orange = oranges[i];
let distance = dist(mouseX, mouseY, orange.x, orange.y);
if (distance < orange.size / 2) {
oranges.splice(i, 1);
selectedWordIndex++;
poem += words[selectedWordIndex] + "\n";
if (selectedWordIndex == words.length - 1) {
noLoop();
}
break;
}
}
}