-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZostera.java
38 lines (30 loc) · 953 Bytes
/
Zostera.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
29
30
31
32
33
34
35
36
37
38
/**
* Zostera class inherite from Immobile and implements all the methods
* @author Adir Zoari 203002753
* @author Idan Levi 305562431
*/
import java.awt.BasicStroke;
import java.awt.Graphics;
import java.awt.Graphics2D;
public class Zostera extends Immobile{
public Zostera(AquaPanel panel,int size,int x,int y) {
super(panel,size,"Zostera",x,y);
// TODO Auto-generated constructor stub
}
@Override
public void drawCreatrue(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(new BasicStroke(3));
g2.setColor(colorr);
g.drawLine(x, y, x, y-size);
g.drawLine(x-2, y, x-10, y-size*9/10);
g.drawLine(x+2, y, x+10, y-size*9/10);
g.drawLine(x-4, y, x-20, y-size*4/5);
g.drawLine(x+4, y, x+20, y-size*4/5);
g.drawLine(x-6, y, x-30, y-size*7/10);
g.drawLine(x+6, y, x+30, y-size*7/10);
g.drawLine(x-8, y, x-40, y-size*4/7);
g.drawLine(x+8, y, x+40, y-size*4/7);
g2.setStroke(new BasicStroke(1));
}
}