Use Keys 1, 2, 3, 4, 5 to fly across the US (navigate the videos) Use Key "G" to play music and key "P" to pause! Use Key 0 to return to the starting screen
A fork of soaring, flying by Lila Gilliam
xxxxxxxxxx
var currentclip = 1;
//let clips = []
// videos
let clip1;
let clip2;
let clip3;
let clip4;
let lastclip;
//music
let BF;
function preload (){
BF = loadSound('BF.mp3');
}
function setup() {
createCanvas(500, 700);
background(110, 162, 196);
textAlign(CENTER);
//clips = ["clip1", "clip2", "clip3","clip4"]
//currentclip = random(clips);
clip1 = createVideo ("clip1.mov") ;
clip1.hide();
clip2 = createVideo ("clip2.mov") ;
clip2.hide();
clip3 = createVideo ("clip3.mov") ;
clip3.hide();
clip4 = createVideo ("clip4.mov") ;
clip4.hide();
lastclip = createVideo ("clip5.mov") ;
lastclip.hide();
currentclip == 1
}
function draw() {
if (currentclip == 1){
background(167, 214, 235);
//TEXT
noStroke();
fill(255);
textSize(30)
textFont('Georgia')
text ("WE'RE SOARING - ", 250, 230);
text ("FLYING", 250, 270);
textSize(20)
text ("Use Keys 1, 2, 3, 4, 5 to fly across the US", 250, 380);
textSize(15)
text ("Create your own route with different number sequences", 250, 420);
textSize(15)
text ("Get started by pressing any number 1-5 on your keyboard", 250, 530);
text ("Press G to set the mood", 250, 570);
text ("Press P if you're a hater", 250, 590);
}
if (currentclip == 2){
background(157, 204, 235);
image(clip1,0, 0, 500, 700);
textSize(20)
text ("11:52 AM", 50, 30);
}
if (currentclip == 3){
background(126, 196, 242);
image(clip2,0, 0, 500, 700);
textSize(20)
text ("12:00 PM / 1:21 PM", 95, 30);
}
if (currentclip == 4){
background(87, 168, 222);
image(clip3,0, 0, 500, 700);
textSize(20)
text ("1:52 PM" , 50, 30);
}
if (currentclip == 5){
background (10, 94, 143);
image(clip4,0, 0, 500, 700);
textSize(20)
text ("5:59 PM" , 50, 30);
}
if (currentclip == 6){
background (6, 55, 84);
image(lastclip,0, 0, 500, 700);
textSize(20)
text ("6:05 PM" , 50, 30);
}
}
function keyPressed(){
if (key == "1"){
currentclip = 2
clip1.loop()
clip2.pause()
clip3.pause()
clip4.pause()
lastclip.pause()
}
if (key == "2"){
currentclip = 3
clip2.loop()
clip3.pause()
clip4.pause()
lastclip.pause()
clip1.pause()
}
if (key == "3"){
currentclip = 4
clip3.loop()
clip4.pause()
lastclip.pause()
clip1.pause()
clip2.pause()
}
if (key == "4"){
currentclip = 5
clip4.loop()
lastclip.pause()
clip1.pause()
clip2.pause()
clip3.pause()
}
if (key == "5"){
currentclip = 6
lastclip.loop()
clip1.pause()
clip2.pause()
clip3.pause()
clip4.pause()
}
if (key == "0"){
currentclip = 1
}
if (key == "p"){
BF.pause();
}
if (key == "g"){
BF.play();
}
}