-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnemyProjectile.java
71 lines (65 loc) · 1.29 KB
/
EnemyProjectile.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import java.awt.Rectangle;
public class EnemyProjectile extends Rectangle{
int speed;
int id;
double dx;
double dy;
boolean valid = true;
boolean ishoming;
boolean active;
public EnemyProjectile(int width, int height, int xx, int yy, int speed) {
super(0,0,width,height);
x = xx;
y = yy;
this.speed = speed;
}
public EnemyProjectile(int width, int height, int xx, int yy, int speed, boolean homing) {
super(0,0,width,height);
x = xx;
y = yy;
ishoming = homing;
this.speed = speed;
}
public EnemyProjectile(int width, int height, int xx, int yy, int speed, boolean homing, boolean active) {
super(0,0,width,height);
x = xx;
y = yy;
ishoming = homing;
this.speed = speed;
this.active = active;
}
public boolean isActive() {
return active;
}
public void turnActive() {
active = true;
}
public void move() {
translate(0,-speed);
}
public void setdx(double num) {
dx = num;
}
public void setdy(double num) {
dy = num;
}
//1~4 - boss 1 pattern
public void setid(int num) {
id = num;
}
public int getid() {
return id;
}
public void moveAt() {
translate((int) (speed * dx), (int) (speed * dy));
}
public boolean gethoming() {
return ishoming;
}
public void hit() {
valid = false;
}
public boolean laser() {
return valid;
}
}