protected void progress(double pixels)
    {
    switch (getDirection()) {
            case 0: 
                y -= pixels;
                break;
                
            case 1:
                x += pixels;
                break;
                
            case 2:
                y += pixels;
                break;
                
            case 3:
                x -= pixels;
                break;
        }
    }