xxxxxxxxxx
234
let img;
let img1;
let img2;
let x = 0;
let music;
let music1;
function preload() {
soundFormats('mp3', 'ogg')
music=loadSound('lofi.mp3');
music1=loadSound('cough.mp3');
img = loadImage('l_lung.png');
img1 = loadImage('r_lung.png');
img2 = loadImage('Branches.png');
}
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
if (music.isPlaying()==0) //lofi
music.play();
if (music1.isPlaying()==0) //cough
music1.play();
background(54, 54, 54);
image(img, 340, 70, 400, 550);
image(img1, 760, 70, 400, 550);
image(img2, 450, 0, 600, 500);
//left lungs
//1949
push();
for (let i = 0; i < 1; i++) {
translate (410, 500);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 20 - sin((frameCount + i) * 0.04) * 10, 20- sin((frameCount + i) * 0.04) * 10);}
pop();
//1951
push();
for (let i = 0; i < 1; i++) {
translate (620, 120);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 30 - sin((frameCount + i) * 0.04) * 10, 30- sin((frameCount + i) * 0.04) * 10);}
pop();
//1953
push();
for (let i = 0; i < 1; i++) {
translate (640, 170);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 30 - sin((frameCount + i) * 0.04) * 10, 30- sin((frameCount + i) * 0.04) * 10);}
pop();
//1955
push();
for (let i = 0; i < 1; i++) {
translate (480, 550);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 55 - sin((frameCount + i) * 0.04) * 10, 55- sin((frameCount + i) * 0.04) * 10);}
pop();
//1957
push();
for (let i = 0; i < 1; i++) {
translate (550, 180);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 45 - sin((frameCount + i) * 0.04) * 10, 45- sin((frameCount + i) * 0.04) * 10);}
pop();
//1959
push();
for (let i = 0; i < 1; i++) {
translate (635, 230);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 70 - sin((frameCount + i) * 0.04) * 10, 70- sin((frameCount + i) * 0.04) * 10);}
pop();
//1961
push();
for (let i = 0; i < 1; i++) {
translate (450, 420);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 80 - sin((frameCount + i) * 0.04) * 10, 80- sin((frameCount + i) * 0.04) * 10);}
pop();
//1963
push();
for (let i = 0; i < 1; i++) {
translate (560, 480);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 90 - sin((frameCount + i) * 0.04) * 10, 90- sin((frameCount + i) * 0.04) * 10);}
pop();
//1965
push();
for (let i = 0; i < 1; i++) {
translate (630, 350);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 150 - sin((frameCount + i) * 0.04) * 10, 150- sin((frameCount + i) * 0.04) * 10);}
pop();
//1967
push();
for (let i = 0; i < 1; i++) {
translate (500, 300);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 120 - sin((frameCount + i) * 0.04) * 10, 120- sin((frameCount + i) * 0.04) * 10);}
pop();
//right lungs
//1950
push();
for (let i = 0; i < 1; i++) {
translate (910, 150);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 20 - sin((frameCount + i) * 0.04) * 10, 20- sin((frameCount + i) * 0.04) * 10);}
pop();
//1952
push();
for (let i = 0; i < 1; i++) {
translate (860, 180);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 30 - sin((frameCount + i) * 0.04) * 10, 30- sin((frameCount + i) * 0.04) * 10);}
pop();
//1954
push();
for (let i = 0; i < 1; i++) {
translate (940, 500);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 30 - sin((frameCount + i) * 0.04) * 10, 30- sin((frameCount + i) * 0.04) * 10);}
pop();
//1956
push();
for (let i = 0; i < 1; i++) {
translate (840, 250);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 55 - sin((frameCount + i) * 0.04) * 10, 55- sin((frameCount + i) * 0.04) * 10);}
pop();
//1958
push();
for (let i = 0; i < 1; i++) {
translate (1050, 380);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 45 - sin((frameCount + i) * 0.04) * 10, 45- sin((frameCount + i) * 0.04) * 10);}
pop();
//1960
push();
for (let i = 0; i < 1; i++) {
translate (835, 330);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 70 - sin((frameCount + i) * 0.04) * 10, 70- sin((frameCount + i) * 0.04) * 10);}
pop();
//1962
push();
for (let i = 0; i < 1; i++) {
translate (870, 420);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 80 - sin((frameCount + i) * 0.04) * 10, 80- sin((frameCount + i) * 0.04) * 10);}
pop();
//1964
push();
for (let i = 0; i < 1; i++) {
translate (950, 360);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 90 - sin((frameCount + i) * 0.04) * 10, 90- sin((frameCount + i) * 0.04) * 10);}
pop();
//1966
push();
for (let i = 0; i < 1; i++) {
translate (1045, 490);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 150 - sin((frameCount + i) * 0.04) * 10, 150- sin((frameCount + i) * 0.04) * 10);}
pop();
//1968
push();
for (let i = 0; i < 1; i++) {
translate (950, 240);
rotate(x-0.3);
noStroke();
fill(160, 163, 163, 180)
ellipse(0, 0, 120 - sin((frameCount + i) * 0.04) * 10, 120- sin((frameCount + i) * 0.04) * 10);}
pop();
}