public int getNextAvatarIndex(int action, int currentAvatarIndex){
        int x = currentAvatarIndex%8;
        int y = currentAvatarIndex/8;
        if(action==UP){
            y--;
        }
        if(action==RIGHT){
            x++;
        } else if(action==DOWN){
            y++;
        } else if(action==LEFT){
            x--;
        }
        if(x<0 || y<0 || x>=8 || y>=8){
            return currentAvatarIndex; // no move
        }
        return x+8*y;
    }