abstract class GameObject{
protected int x, y;
public GameObject(int startX,int startY) {
this.x=startX;
this.y=startY;
}
public int getX() {return x;}
public int getY() {return y;}
public boolean collide(GameObject P) {
if(this.x==P.getX()&&this.y==P.getY())
return true;
else
return false;
}
protected abstract void move(char direction);
protected abstract char getShape();
}
class Player extends GameObject{
public Player() {
super(1,1);
}
public Player(int x, int y) {
super(x,y);
}
public int getX() {return x;}
public int getY() {return y;}
protected void move(char direction) {
if((direction=='a'&&x==0)||(direction=='s'&&y==9)||(direction=='w'&&y==0)||(direction=='d'&&x==19)) {
System.out.println("***ERROR***");
System.out.println("SYSTEM ERROR 엘레레렐ㄹㄹ레ㅔㄹ레레레(대충 오류났을때 나오는 거)");
System.out.println("키 안알려줌.게임 많이 했으면 이거 국룰이라 알텐데 ㅋㅋㅋ.어쨌든 오류니까 한 턴 가져감ㅅㄱ");
}
else if(direction=='a')
x--;
else if(direction=='w')
y++;
else if(direction=='s')
y--;
else
x++;
}
protected char getShape() {return '?';}
}
class Main{
public static void main(String[] args) {
Player p= new Player();
}
}
class Jjam extends Player{
public Jjam() {
super(5,10);
}
public void move(char direction) {
if(x+3>getX()&&x-3<getX()&&y+3>getY()&&y-3<getY())
}
public char getShape() {return 'ㅋ';}
}