xxxxxxxxxx
72
let bg;
let str;
let font;
let sound;
let counter = 0;
function preload() {
bg = loadImage("bg.jpg");
//image downloaded from google
//https://i.ytimg.com/vi/YvlQ8TQsmQA/maxresdefault.jpg
//it's a screenshot of Rainer Werner Fassbinder's movie 'World on a Wire' ('Welt am Draht' in German).This cool scene shows the main character and the women from the 'higher world' who fall in love with him in the mirrors.
font = loadFont("Baumans-Regular.ttf");
sound = loadSound("music.mp3");
//World on a Wire Theme
//https://www.youtube.com/watch?v=KOaD45VUGAE
}
function setup() {
createCanvas(bg.width * 0.6, bg.height * 0.6);
str = "NEWS: Sims escaped to real world said: 'here is just a stop, not destination', after being caught.";
//term "sims" is from the video game series "The Sims", in which "sims" refers to the virtual people in the games.
background(122);
frameRate(60);
sound.loop();
}
function draw() {
imageMode(CORNER);
image(bg, 0, 0, width, height);
textFont(font);
textSize(30);
textStyle(BOLD);
textAlign(LEFT, TOP);
strokeWeight(5);
let d, d2 = 0;
if (counter < 180) {
d = map(counter, 0, 180, 0, height / 2);
counter++;
} else if (counter < 360) {
d = height / 2;
noStroke();
fill(255);
text(str, 80 + 1, height * 0.5, width * 0.8, height * 0.8);
fill(137, 184, 245);
text(str, 80, height * 0.5, width * 0.8, height * 0.8);
counter++;
} else if (counter < 720) {
d = height / 2;
d2 = map(counter, 360, 720, 0, height);
noStroke();
fill(255);
text(str, 80 + 1, height * 0.5 + d2, width * 0.8, height * 0.8 + d2);
fill(137, 184, 245);
text(str, 80, height * 0.5 + d2, width * 0.8, height * 0.8 + d2);
counter++;
} else {
counter = 0
}
stroke(255);
line(111, 0 + d2, 111, d + d2);
line(81, 0 + d2, 81, d + d2);
line(181, 0 + d2, 181, d + d2);
line(211, 0 + d2, 211, d + d2);
line(251, 0 + d2, 251, d + d2);
stroke(137, 184, 245);
line(110, 0 + d2, 110, d + d2);
line(80, 0 + d2, 80, d + d2);
line(180, 0 + d2, 180, d + d2);
line(210, 0 + d2, 210, d + d2);
line(250, 0 + d2, 250, d + d2);
//the number of the 'higher world' to escape to is infinite, that's why it's looping
}