Poly 002

Poly 002

Log in to post a comment.

// You can find the Turtle API reference here: https://turtletoy.net/syntax
// Released under the MIT licence 
// https://mit-license.org/
// you can use this for commercial gain if you like eg you can sell artworks with this image.

Canvas.setpenopacity(1);

// Global code will be evaluated once.
const turtle = new Turtle();
const stepSize = 20; //min=1,max=100, step=1
const angle = 90; //min=1,max=500, step=1
const numberOfSides = 5; //min=1,max=500, step=1
const xOffset = -50; //min=-100, max=100, step=1
const yOffset = -20; //min=-100, max=100, step=1

turtle.penup();
turtle.goto(xOffset, yOffset);
turtle.pendown();

// The walk function will be called until it returns false.
function walk(i) {
    turtle.forward(stepSize); 
    turtle.right(angle);
    return i < numberOfSides;
}