-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBullet.java
50 lines (44 loc) · 970 Bytes
/
Bullet.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
/*
* This is the Bullet class for Test_Game.
* Bullet is created by Controller (in front of the player).
* Very similar to Player (might be good for inheritance).
* @author gliebchen
* @version 1.0
* @since 2016-03-16
*/
public class Bullet {
private int rowCoord;
private int colCoord;
private char appearance;
private boolean dead;
public Bullet(int r, int c){
intialiseBullet(r,c);
}
private void intialiseBullet(int r, int c){
appearance = '.';
rowCoord = r;
colCoord = c;
dead = false;
}
public int[] suggestMove(){
int [] location = {rowCoord,colCoord+1};
return location;
}
public char getAppearance(){
return appearance;
}
public void setLocation(int[] location){
rowCoord=location[0];
colCoord=location[1];
}
public int[] getLocation(){
int[] location = {rowCoord,colCoord};
return location;
}
public boolean isDead(){
return dead;
}
public void setDead(boolean death){
dead = death;
}
}