xxxxxxxxxx
var rih;
var anthemRate = 1;
var songLength;
function preload(){
rih = loadSound("rhi.mp4")
}
function setup() {
createCanvas(400, 400);
rih.play();
rih.rate (anthemRate);
songLength = rih.duration();
}
function draw() {
background(265);
fill (230, 230, 250);
rect (80, 200, 250, 150);
rect (80, 170, 250, 10);
rect (80, 170, 10, 30);
rect (320, 170, 10, 30);
fill (102, 51, 153);
rect (100, 190, 25, 10);
rect (130, 190, 10, 10);
rect (145, 190, 10, 10);
rect (285, 190, 10, 10);
rect (300, 190, 10, 10);
/// radio box
circle (145, 225, 15);
circle (165, 225, 15);
circle (260, 225, 15);
circle (280, 225, 15);
ellipse (212, 230, 20, 30);
/// buttons
circle (135, 280, 70);
circle (135, 280, 65);
circle (285, 280, 70);
circle (285, 280, 65);
rect (185, 260, 50, 40);
rect (185, 260, 50, 10);
/// screen
circle (180, 310, 5);
circle (200, 310, 5);
circle (220, 310, 5);
circle (240, 310, 5);
}
function keyPressed(){
if(key == 'p'){
rih.play();
}
if(key == 's'){
rih.stop();
}
if(keyCode ==RIGHT_ARROW){
anthemRate += 0.25;
}
if(keyCode ==LEFT_ARROW){
anthemRate -= 0.25;
}
if(key == '1'){
rih.jump (10);
}
if(key == '2'){
rih.jump (20);
}
if(key == '3'){
rih.jump (30);
}
}