This repository has been archived by the owner on Mar 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboneDoor.java
65 lines (57 loc) · 1.45 KB
/
boneDoor.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
65
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class boneDoor extends StaticEntity{
BufferedImage texture;
private int width,height;
private boolean direction;
public boneDoor(Handler handler, float x, float y, boolean direction){
super(handler, x,y,Tile.TILEWIDTH, Tile.TILEHEIGHT);
this.direction = direction;
if(direction){
texture = Assets.boneDoor;
bounds.x = 0;
bounds.y = 40;
bounds.width = 124;
bounds.height = 24;
width = 2* Tile.TILEWIDTH;
height = Tile.TILEHEIGHT;
} else {
texture = Assets.boneDoor2;
bounds.x = 0;
bounds.y = 0;
bounds.width = 30;
bounds.height = 100;
width = 30;
height = 2 * Tile.TILEHEIGHT;
}
}
public void update(){
}
public void render(Graphics g){
g.drawImage(texture,(int)(x - handler.getCamera().getxOffset()),(int)(y - handler.getCamera().getyOffset()),width,height,null);
}
public boolean isSolid(){
return true;
}
public void die(){
handler.setNotification("Bone door opened");
if(!direction){
texture = Assets.boneDoor;
width = 2* Tile.TILEWIDTH;
height = Tile.TILEHEIGHT;
y -= 40;
} else {
texture = Assets.boneDoor2;
width = 30;
height = 100;
}
bounds.x = 0;
bounds.y = 0;
bounds.width = 0;
bounds.height = 0;
direction = !direction;
}
public int isDoor(){
return 3;
}
}