-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBomb.java
64 lines (47 loc) · 888 Bytes
/
Bomb.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
package bomber;
import java.awt.Graphics;
import tge.tileset.Indexable;
public class Bomb implements Indexable {
public static final int LIFE_SPAND=Game.LOGIC*3;
private int power=2;
private Bomber owner;
private int countdown=LIFE_SPAND;
public int GetCountdown() {
return countdown;
}
public void ignite() {//start explosion
countdown=4;
}
public Bomb(int pow,Bomber owner) {
this.owner=owner;
power=pow;
}
@Override
public void draw(Graphics g) {
}
@Override
public double Zindex() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void update() {
countdown--;
}
@Override
public int textureId() {
int pos=(countdown/8)%6;
if(pos==4)
pos=2;
if(pos==5)
pos=1;
//System.out.println(pos);
return 1+pos;
}
public int getPower() {
return power;
}
public Bomber getOwner() {
return owner;
}
}