xxxxxxxxxx
70
let picture;
let song;
function preload() {
picture = loadImage('fox.JPG'); //background
song = loadSound('birds-singing.mp3'); //birds in background sound
}
function setup() {
getAudioContext().suspend(); //music
createCanvas(700, 700);
image(picture, 0, 0); //background photo
song.play();
song.loop();
colorMode(HSB);
}
function draw() {
textSize(18); //text
text('Tap screen to change color of the sun and hear background noise.', 16, 660);
noStroke();
circle(mouseX, mouseY, 20);// mouse that follows finger
stroke(255);
strokeWeight(4);
line(85, 632, 545, 632); // tent
line(383, 632, 383, 509);
line(383, 509, 324, 632);
line(383, 509, 427, 632);
line(383, 509, 225, 509);
line(225, 509, 174, 632);
line(123, 632, 123, 368);
line(123, 368, 77, 399);
line(123, 368, 166, 399);
line(123, 421, 81, 449);
line(123, 421, 166, 449); //tree
line(123, 474, 81, 500);
line(123, 474, 166, 500);
// text(mouseX + ", " + mouseY, 10, 15);
if (mouseIsPressed) {
userStartAudio(); //audio
let brightness = random(85, 100);
let hue = random(20, 55);
let saturation = random(50, 100);
let x = random(20);
frameRate(13);
fill(hue, saturation, brightness, x);
circle(500, 75, 90);
noStroke();
}
}