-
Notifications
You must be signed in to change notification settings - Fork 2
/
Explosion.java
43 lines (37 loc) · 900 Bytes
/
Explosion.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
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
/**
* An explosion is occurs when two objects collide and at least
* one is destroyed.
* @author Steven Raines
*
*/
public class Explosion extends MovingScreenObject {
private int age;
/**
* Create an Explosion as a particular place, with a
* particular size, a particular point value, and an image.
* @param location The location.
* @param size The size (width and height)
* @param pv The point value
* @angle angle The angle of the object.
*/
public Explosion(Point location, Rectangle size, Image i, double angle, int expAge) {
super(location, size, i, angle);
age = expAge;
}
/**
* Decrements the age of the explosion.
*/
public void move() {
age--;
}
/**
* Returns the explosions age.
* @return the age of the explosion.
*/
public int getAge() {
return age;
}
}