-
Notifications
You must be signed in to change notification settings - Fork 2
/
Powerup.java
48 lines (43 loc) · 988 Bytes
/
Powerup.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
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
/**
*
* @author Steven Raines
*
*/
public class Powerup extends MovingScreenObject {
protected ObjectVector arbitraryVector;
protected Image arbitraryImage;
/**
*
* @param location location of the powerup
* @param size size of the powerup
* @param i image of the powerup
*/
public Powerup(Point location, Rectangle size, Image i) {
super(location, size, i, 0);
arbitraryImage = i;
this.setArbitraryVector(new ObjectVector(0, 0));
}
/**
* draw the powerup
*/
public void draw(Graphics g)
{
g.drawImage(arbitraryImage, location.x, location.y, size.width, size.height, null);
}
/**
* @return the arbitraryImage
*/
public Image getArbitraryImage() {
return arbitraryImage;
}
/**
* @param arbitraryImage the arbitraryImage to set
*/
public void setArbitraryImage(Image arbitraryImage) {
this.arbitraryImage = arbitraryImage;
}
}