-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIllFace.java
30 lines (22 loc) · 1.01 KB
/
IllFace.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.awt.*;
import java.awt.Color;
import javax.swing.*;
public class IllFace extends Person {
public IllFace (Vec initPosition, Vec initVelocity, int nb, double probToGetInfected, boolean mask, boolean vaccine){
super(initPosition, initVelocity, nb, probToGetInfected, mask, vaccine);
}
public void drawFaces (Graphics g, boolean socialDist){
super.drawFaces(g,socialDist);
g.setColor(Color.red);
g.fillOval ((int)(position.x-RADIUS), (int)(position.y-RADIUS),(int)(2*RADIUS), (int)(2*RADIUS));
g.drawOval ((int)(position.x-INFECT_RADIUS), (int)(position.y-INFECT_RADIUS),(int)(2*INFECT_RADIUS), (int)(2*INFECT_RADIUS));
if (socialDist && this.socialDistancingRespect) {
g.setColor(Color.green);
g.drawOval ((int)(position.x-INFECT_RADIUS), (int)(position.y-INFECT_RADIUS),(int)(2*INFECT_RADIUS), (int)(2*INFECT_RADIUS));
}
if (wearMask) {
g.setColor(Color.white);
g.fillRect((int)(position.x-RADIUS) , (int)(position.y-(RADIUS-3)/2),(int)(2*RADIUS), (int)(0.7*RADIUS));
}
}
}