/**
 *  The Tunnel turtle creates an interesting "tunnel" effect.  Run it to see.
 *
 */

import java.awt.*;
import javax.swing.*;
import com.otherwise.jurtle.Turtle;

public class Tunnel extends Turtle
{


    /**
     *  Main entry point.
     */
    public void runTurtle()
    {
        hideTurtle();

        Dimension size = getDisplaySize();

        for ( int i = 0; i <= size.width; i += 10 )
        {
            moveTo( i, 0 );
            setPosition( size.width - i, size.height );
        }

        for ( int i = 0; i < size.height; i += 10 )
        {
            moveTo( 0, i );
            setPosition( size.width, size.height - i );
        }
    }


    /**
     *  Helper routine to move the turtle without drawing a line.
     */
    private void moveTo( int x, int y )
    {
        penUp();
        setPosition( x, y );
        penDown();
    }


}

