-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEntity.java
More file actions
35 lines (28 loc) · 725 Bytes
/
Entity.java
File metadata and controls
35 lines (28 loc) · 725 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
public class Entity {
public void setPosition(int xPos, int yPos){ //TODO: put in error handling for out-of-bounds areas
if(currentLevel.containsTile(xPos, yPos)){
currentTile = currentLevel.layout[xPos][yPos];
currentTile.setIcon(icon);
currentTile.isPassable=!solid;
}
}
public void setIcon(char icon){
this.icon=icon;
}
public int getXPos(){
return currentTile.xCoord;
}
public int getYPos(){
return currentTile.yCoord;
}
public Level getCurrentLevel() {
return currentLevel;
}
public void setCurrentLevel(Level currentLevel) {
this.currentLevel = currentLevel;
}
public boolean solid = true;
private char icon;
protected Level currentLevel;
protected Tile currentTile;
}