48 lines
772 B
Java
48 lines
772 B
Java
|
|
public class Wall extends Picture {
|
|
private int pos = 0;
|
|
private int posX;
|
|
private int posY;
|
|
private int sizeX;
|
|
private int sizeY;
|
|
|
|
public Wall(int pos) {
|
|
super("player");
|
|
this.pos = pos;
|
|
if (pos == 0) {
|
|
sizeX = 570;
|
|
sizeY = 10;
|
|
posX = 10;
|
|
posY = 10;
|
|
} else if (pos == 1) {
|
|
sizeX = 10;
|
|
sizeY = 650;
|
|
posX = 10;
|
|
posY = 10;
|
|
} else if (pos == 2) {
|
|
sizeX = 570;
|
|
sizeY = 10;
|
|
posX = 10;
|
|
posY = 650;
|
|
}
|
|
}
|
|
|
|
public int getPosi(char coordinate) {
|
|
if (coordinate == 'x') {
|
|
return posX;
|
|
} else if (coordinate == 'y') {
|
|
return posY;
|
|
} else
|
|
return 0;
|
|
}
|
|
|
|
public int getSize(char coordinate) {
|
|
if (coordinate == 'x') {
|
|
return sizeX;
|
|
} else if (coordinate == 'y') {
|
|
return sizeY;
|
|
} else
|
|
return 0;
|
|
}
|
|
}
|