class Animal { int x = 0; int y = 0; int mortality = int(random(50)+20); boolean move = true; float z = 0; int index; int health = 0; int seed = int(random(200)); boolean quarantineAnimal = false; Animal(int X,int Y){ x = X+3; y = Y+3; } /* The conditions for health are as follows, 0 = healthy, 1 = sick, 2 = dead. */ void Draw(){ ellipseMode(CORNER); if(health == 0){ stroke(1); fill(227,196,158); // image(myPerson, x, y); rect(x,y,8,8);//The healthy are white rectangles } else if(health == 1){ fill(0,255,0); // image(redPerson, x, y); rect(x,y,6,6);//The sick are green and emaciated. They also move slower - RECTANGLE! } else{ move = false; fill(211,9,9); // image(deadPerson, x, y); rect(x,y,4,4);//the dead are red and immobile. } //QUARANTINE BOTTOM RIGHT CORNER if ((mouseX > 400) && (mouseX < 800) && (mouseY > 300 ) && (mouseY < 600)){ // this basically says "if up is pressed, do the following (play //radar left to right) for(int I = 0;I 400 && Animal[I].x < 800 && Animal[I].y > 300 && Animal[I].y < 600) { quarantineAnimal=true; noFill(); strokeWeight(3); stroke(255); rect(400, 300, 399, 299); fill(255); textSize(35); text("QUARANTINED", 460, 450); Animal[I].health = 0; Animal[I].move = false; } } } } } //QUARANTINE TOP RIGHT CORNER if ((mouseX > 400) && (mouseX < 800) && (mouseY > 0 ) && (mouseY < 300)){ // this basically says "if up is pressed, do the following (play //radar left to right) for(int I = 0;I 400 && Animal[I].x < 800 && Animal[I].y > 0 && Animal[I].y < 300) { quarantineAnimal=true; noFill(); strokeWeight(3); stroke(255); rect(400, 1, 399, 299); fill(255); textSize(35); text("QUARANTINED", 450, 150); Animal[I].move = false; } } } } } //QUARANTINE TOP LEFT CORNER if ((mouseX > 0) && (mouseX < 400) && (mouseY > 0 ) && (mouseY < 300)){ // this basically says "if up is pressed, do the following (play //radar left to right) for(int I = 0;I 0 && Animal[I].x < 400 && Animal[I].y > 0 && Animal[I].y < 300) { quarantineAnimal=true; noFill(); strokeWeight(3); stroke(255); rect(1, 1, 399, 299); fill(255); textSize(35); text("QUARANTINED", 140, 150); Animal[I].move = false; } } } } } //QUARANTINE BOTTOM LEFT CORNER if ((mouseX > 0) && (mouseX < 400) && (mouseY > 300 ) && (mouseY < 600)){ // this basically says "if up is pressed, do the following (play //radar left to right) for(int I = 0;I 0 && Animal[I].x < 400 && Animal[I].y > 300 && Animal[I].y < 600){ quarantineAnimal = true; noFill(); strokeWeight(3); stroke(255); rect(1, 300, 399, 299); fill(255); textSize(35); text("QUARANTINED", 50, 450); Animal[I].move = false; } } } } } } void Move(){ if(move == true){ noiseSeed(seed); x+=int(noise(z)*20-10); y+=int(noise(z-200)*20-10); z+=.1; } } void checkHit(){//This is collision detction, the sick will transmit the disease by touch. for(int I = 0;I