-
Notifications
You must be signed in to change notification settings - Fork 0
/
SubmachineGun.java
42 lines (37 loc) · 981 Bytes
/
SubmachineGun.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
39
40
41
42
import java.io.IOException;
import javax.imageio.ImageIO;
/**
* Submachine gun class. Submachine gun is a tower. It costs 450, can attack 3
* enemy at a time and has a diameter of 150 px
*
* @author haolidu
* @version 1.00
*/
public class SubmachineGun extends Tower {
/**
* Constructor for Submachine gun.
*
* @param x
* @param y
* @throws IOException
*/
public SubmachineGun(int x, int y) throws IOException {
super(x, y);
setAttackRadius(150);
setAttackPower(2);
icon = ImageIO.read(getClass().getResource("submachine.png"));
circle = new Circle(x - getAttackRadius() / 2, y - getAttackRadius()
/ 2, getAttackRadius());
simulAttack = 3;
cost = 450;
}
/**
* Gets the String representation of the tower.
*
* @return String of the tower
*/
@Override
public String toString() {
return "Submachine Gun Tower";
}
}