xxxxxxxxxx
let mySound;
var margin = -50;
var a;
var b;
var c;
var d;
var e;
var f;
var g;
var z;
var i;
var j;
function preload() {
soundFormats('mp3', 'ogg');
mySound = loadSound('mashup');
a = loadImage("dressy.png");
b = loadImage("radio.png");
c = loadImage("macrame.png");
d = loadImage("mirror.png");
e = loadImage("cds.png");
f = loadImage("frame1.png");
g = loadImage("frame2.png");
z = loadImage("smiley2.png");
i = loadImage("smiley1.png");
j = loadImage("speaker.png");
}
function setup() {
createCanvas(1750, 1200);
frameRate(1);
on = false;
off = true;
mySound.play();
}
function draw() {
background(238, 223, 214);
fill(214, 220, 221);
rect(-10, -10, 1770, 41);
rect(-10, -10, 1770, 32);
rect(-10, 986, 1770, 182);
rect(-10, 995, 1770, 182);
rect(-10, 648, 1770, 22);
fill(random(150, 200), random(150, 200), random(150, 200));
rect(910, 370, 350, 625);
image(a, 50, 400);
image(b, 1370, 602);
image(c, 985, 65);
image(e, 1425, 238);
image(f, 518, 100);
image(g, 120, 100);
fill(random(150, 200), random(150, 200), random(150, 200));
ellipse(1570, 701, 55, 55);
ellipse(1490, 701, 55, 55);
strokeWeight(2);
image(d, 890, 352.5);
image(j, 1370, 602);
fill(random(150, 200), random(150, 200), random(150, 200));
rect(143, 122, 210, 284);
rect(-10, 1016, 1770, 185);
fill(random(150, 200), random(150, 200), random(150, 200));
rect(537, 120, 136, 155);
rect(0, 1016, 70, 70);
rect(280, 1016, 70, 70);
rect(560, 1016, 70, 70);
rect(840, 1016, 70, 70);
rect(1120, 1016, 70, 70);
rect(1400, 1016, 70, 70);
rect(1680, 1016, 70, 70);
rect(140, 1156, 70, 70);
rect(420, 1156, 70, 70);
rect(700, 1156, 70, 70);
rect(980, 1156, 70, 70);
rect(1260, 1156, 70, 70);
rect(1540, 1156, 70, 70);
//row1
fill(214, 220, 221);
rect(140, 1016, 70, 70);
rect(420, 1016, 70, 70);
rect(700, 1016, 70, 70);
rect(980, 1016, 70, 70);
rect(1260, 1016, 70, 70);
rect(1540, 1016, 70, 70);
//row2
rect(70, 1086, 70, 70);
rect(210, 1086, 70, 70);
rect(350, 1086, 70, 70);
rect(490, 1086, 70, 70);
rect(630, 1086, 70, 70);
rect(770, 1086, 70, 70);
rect(910, 1086, 70, 70);
rect(1050, 1086, 70, 70);
rect(1190, 1086, 70, 70);
rect(1330, 1086, 70, 70);
rect(1470, 1086, 70, 70);
rect(1610, 1086, 70, 70);
//row3
rect(0, 1156, 70, 70);
rect(280, 1156, 70, 70);
rect(560, 1156, 70, 70);
rect(840, 1156, 70, 70);
rect(1120, 1156, 70, 70);
rect(1400, 1156, 70, 70);
rect(1680, 1156, 70, 70);
strokeWeight(2);
image(z, 518, 100);
image(i, 120, 100);
fill(245, 246, 205);
rect(1411, 80, 238, 118);
fill(214, 220, 221);
rect(1423, 92, 214, 94);
fill(255);
textSize(24);
ellipse(mouseX, mouseY, 3, 3);
text(mouseX, mouseX + 10, mouseY);
text(mouseY, mouseX + 10, mouseY + 30);
let h = nf(hour(),2)
let m = nf(minute(),2)
console.log(h + ':'+ m)
let time = h + ':'+ m
{
time = h + ':'+ m
}
textSize(75)
fill(232, 148,191)
text(time, 1433, 165)
textSize(25)
text('click radio to play music', 1395, 585)
text('click books to read them', 113.5, 462)
text('click posters to change them', 447.5, 328)
}
//function mouseClicked() {
//if (mouseX > 1447 && mouseX < 1614 && mouseY > 660 && mouseY < 740){
//mySound.play();
//}
//}
function mouseClicked() {
if (off) {
mySound.play();
on = true;
off = false;
}
else {
mySound.pause();
off = true;
on = false;
}
}