New turtle with Sliders

Adding sliders to the New turtle code

Log in to post a comment.

// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(1);

// Global code will be evaluated once.
const offsetX=-92; //min=-200 max=200 step=1
const offsetY=-53; //min=-200 max=200 step=1
const size=100; //min=5 max=200 step=1
const angle=0; //min=0 max=360 step=1

const turtle = new Turtle();
turtle.penup();
turtle.goto(offsetX, offsetY); // change the starting position
turtle.right(angle) // change the starting angle
turtle.pendown();

// The walk function will be called until it returns false.
function walk(i) {
    turtle.forward(size); // change the size
    turtle.right(144);
    return i < 4;
}