Use Keys "1", "2", "3" to navigate the highlight reel and choose a song. Use Key "P" to pause the song. Click on the button to find streaming options!
A fork of My Sketch by Lila Gilliam
xxxxxxxxxx
var scene = 1;
let playMode = 'restart';
let capture;
//buttons
let downbutton;
let fatebutton;
let towbutton;
let gradient1;
var amp;
var level;
function preload (){
//music
down = loadSound ('down.mp3');
fate = loadSound ('fate.mp3');
TOW = loadSound('TOW.mp3');
//images
downcov = loadImage ('downcov.png');
fatecov = loadImage ('fatecov.png');
tugcov = loadImage ('tugcov.JPEG');
rope = loadImage ('rope.png');
lilajai = loadImage ('lilajai.png');
one = loadImage('1.png');
three = loadImage('2.png');
two = loadImage('3.png');
capture = createCapture({
audio: false,
video: { width: 320, height: 240 }
},
function() { //creating a function
console.log('capture ready.'); //letting user know webcam works at the bottom
});
capture.hide();
}
function setup() {
createCanvas(600, 600);
amp = new p5.Amplitude();
imageMode (CENTER);
button = createButton("stream here");
button.position(690, 600);
gradient1 = createLinearGradient(0, 600);
gradient1.colors(0, "white" , 0.5, "maroon",1, "white" );
}
function link1() {
window.open("https://unitedmasters.com/m/5f7513d76ac7de715a9970b5")
}
function link2() { window.open("https://unitedmasters.com/m/60118a086ac7de1faa80be73")
}
function link3() {
window.open("https://tr.ee/VaO7-kxbXU")
}
function draw() {
background(220);
level = amp.getLevel();
if (scene == 1){
drawscene1();
}
if (scene == 2){
drawscene2();
}
if (scene == 3){
drawscene3();
}
}
function keyPressed(){
if (key == '1'){
scene = 1;
down.play();
fate.stop();
TOW.stop();
}
if (key == '2'){
scene = 2;
fate.play();
down.stop();
TOW.stop();
}
if (key == '3'){
scene = 3;
TOW.play();
down.stop();
fate.stop();
}
if (key == "p"){
down.stop();
fate.stop();
TOW.stop();
}
}
function drawscene1(){
background(207, 182, 219);
tint(184, 126, 230);
image(capture, 300, 300, 500, 400);
noTint();
noStroke();
fill(255, 132, 0);
capture.loadPixels();
let stepSize = 12;
for (let y = 100; y < 500; y += stepSize) {
for (let x = 51; x < 553; x += stepSize) {
const i = y * 2 + x;
const darkness = (150 - capture.pixels[i * 3]) / 205;
const radius = stepSize * darkness;
ellipse(x, y, radius, radius);
}
}
button.mousePressed(link1);
image(downcov, 100, 100, 150, 150);
image(downcov, 100, 100, 100, 100);
image(downcov, 100, 100, 50, 50);
image(downcov, 500, 500, 150, 150);
image(downcov, 500, 500, 100, 100);
image(downcov, 500, 500, 50, 50);
image(one, 500, 60, 270, 250);
image(lilajai, mouseX, mouseY, 70, 70);
}
function drawscene2(){
background(20,20,100);
noStroke()
fill(255)
circle(30, 40, level*200);
circle(45, 40, level*300);
circle(55, 40, level*350);
circle(70, 40, level*300);
circle(85, 40, level*200);
circle(350, 60, level*500);
circle(370, 60, level*600);
circle(390, 60, level*700);
circle(405, 60, level*600);
circle(425, 60, level*500);
circle(50, 150, level*200);
circle(70, 150, level*300);
circle(90, 150, level*400);
circle(105, 150, level*300);
circle(125, 150, level*200);
circle(445, 150, level*300);
circle(465, 150, level*400);
circle(485, 150, level*500);
circle(500, 150, level*400);
circle(520, 150, level*300);
circle(450, 350, level*300);
circle(470, 350, level*400);
circle(490, 350, level*500);
circle(505, 350, level*400);
circle(525, 350, level*300);
circle(50, 450, level*300);
circle(70, 450, level*400);
circle(90, 450, level*500);
circle(105, 450, level*400);
circle(125, 450, level*300);
circle(350, 500, level*300);
circle(370, 500, level*400);
circle(390, 500, level*500);
circle(405, 500, level*400);
circle(425, 500, level*300);
level = amp.getLevel()
//print(level);
size = map(level, 0, 0.21, 100, 500);
image(fatecov, 300, 300, 400, 400);
image(two, mouseX, mouseY, 280, 210);
button.mousePressed(link2);
}
function drawscene3(){
background(242, 210, 203);
fillGradient(gradient1);
rect(0, 0, 600, 600);
image (rope, 300, 50, 600, 600);
image (rope, 300, 550, 600, 600);
image(tugcov, 300, 300, 400, 400);
fill(209, 49, 15);
circle(40, 40, 30 + level * 200);
circle(560, 40, 30 + level * 200);
circle(560, 560, 30 + level * 200);
circle(40, 560, 30 + level * 200);
fill(255);
circle(40, 40, 15 + level * 50);
circle(560, 40, 15 + level * 50);
circle(560, 560, 15 + level * 50);
circle(40, 560, 15 + level * 50);
image(three, 500, 80, 200, 140);
image(lilajai, mouseX, mouseY, 70, 70);
button.mousePressed(link3);
}