public boolean moveLine(int x0,int y0,int x1,int y1)//让块按照直线走,走完返回true
    {
        int x=this.getX();
        int y=this.getY();

        if(x0==x1&&y0==y1)//not line
            return true;
        if(x0==x1)//horizen line
        {
            if(y0>y1)
                y-=5;
            else
                y+=5;
            if(y==y1)
            {
                this.setLocation(x, y);
                return true;
            }
        }
        if(y0==y1)//vertical line
        {
            if(x0>x1)
                x-=5;
            else
                x+=5;
            if(x==x1)
            {
                this.setLocation(x, y);
                return true;
            }
        }
        this.setLocation(x, y);
        return false;
    }