-
Notifications
You must be signed in to change notification settings - Fork 0
/
OBJ_Heart.java
33 lines (32 loc) · 970 Bytes
/
OBJ_Heart.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
//package object
package object;
//imports
import java.io.IOException;
import javax.imageio.ImageIO;
import Main.GamePanel;
//public class OBJ_Heart
public class OBJ_Heart extends SuperObject {
//GamePanel gp
GamePanel gp;
//public OBJ_Heart
public OBJ_Heart(GamePanel gp) {
//this.gp equal to gp
this.gp=gp;
//name equal to Heart
name = "Heart";
//try
try {
//set health images
image = ImageIO.read(getClass().getResourceAsStream("/objects/heart_full.png"));
image2 = ImageIO.read(getClass().getResourceAsStream("/objects/heart_half.png"));
image3 = ImageIO.read(getClass().getResourceAsStream("/objects/heart_blank.png"));
image = uTool.scaleImage(image, gp.tileSize, gp.tileSize);
image2 = uTool.scaleImage(image2, gp.tileSize, gp.tileSize);
image3 = uTool.scaleImage(image3, gp.tileSize, gp.tileSize);
}//end try
//catch
catch(IOException e) {
e.printStackTrace();
}//end catch
}//end OBJ_Heart method
}//end class