-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBomb.java
More file actions
48 lines (41 loc) · 845 Bytes
/
Bomb.java
File metadata and controls
48 lines (41 loc) · 845 Bytes
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
import java.awt.Image;
public class Bomb extends FruitType_Bomb {
private Image explosion;
private boolean exploded;
private int scale;
public Bomb() {
super("bomb");
scale = 200;
explosion = loadExplosion(scale, "explosion.png");
}
/**
* Increment the image of the explosion
*/
public void incrementScale() {
if (scale < WIDTH - 200) {
scale += 100;
explosion = loadExplosion(scale, "explosion.png");
}
}
/**
*
* @return image of the explosion
*/
public Image getExplosion() {
return explosion;
}
/**
*
* @return true if the bomb was exploded otherwise false
*/
public boolean isExploded() {
return exploded;
}
/**
* Set the explosion true or false
* @param flag
*/
public void setExplosion(boolean flag) {
exploded = flag;
}
}