public void move(int x , int y){
	int currLevel=-1;
              this.getTextField().setText(score+"");
   if(showScore){
       showScore=false;
       this.getDialog().setSize(400, 400);
       this.getDialog().setVisible(true);
   
   }
	//boolean stairs=false;
	try{

		currLevel=Integer.parseInt(level[y][x]+"");
	if(enterStairs){
		enterStairs=false;
		Level lev =this.getBoard().getLevels()[currLevel];
		char[][] newLevel=lev.getLevel();

		this.getBoard().setLevel(newLevel);
		this.setCurrlevel(newLevel);
	String stair= lev.getStairs()[board.getLevelNo()];
	int posY=Integer.parseInt(stair.substring(0,stair.indexOf(' ')));
	int posX=Integer.parseInt(stair.substring(stair.indexOf(' ')+1,stair.length()));
	setX(posX);
	setY(posY);
	this.board.setLevelNo(currLevel);
return;
	}
	}catch(Exception e){

	}
  if(level[y][x]==' '&&board.hard==3){
      level[y][x]='x';
  }
    else if(level[y][x] == 'r' && board.hard == 3)
    {
            score--;
            
        }
if(left&&up && y-1>=0 && x-1>=0 &&(level[y-1][x - 1] != 'x')){
    this.setX(x-1);
    this.setY(y-1);
}
 else if (left && down && y + 1 <level.length  && x - 1 >= 0 && (level[y + 1][x - 1] != 'x')) {
    this.setX(x-1);
    this.setY(y+1);
}
         else if (right && down && y + 1 <level.length  && x + 1 < level.length && (level[y + 1][x + 1] != 'x')) {
    this.setX(x+1);
    this.setY(y+1);
}
         else if (right && up && y-1 >=0  && x + 1 < level.length && (level[y -1][x + 1] != 'x')) {
    this.setX(x+1);
    this.setY(y-1);
}
         else if(level[y][x]=='*'){
            level[y][x]=' ';
            this.score++;
        }
 else if (left && x - 1 >= 0 && level[y][(x - 1)] != 'x')
    {
		this.setX(x-1);

	}

    else if(right && x + 1 < level.length && level[y][(x + 1)] != 'x')
    {
		this.setX(x+1);

	}
    else if(up && y - 1 >= 0 && level[(y - 1)][x] != 'x')
    {

		this.setY(y-1);
	}
    else if(down && y + 1 < level.length && level[y + 1][x] != 'x')
    {
		this.setY(y+1);
	}
    
}