Dunes

HEIGHT changes dunes height, negative opacity looks cool too.

Created by rsk on 2019/4/25
180
0

Log in to post a comment.

const HEIGHT = 30; // 10~40 - recommended value

Canvas.setpenopacity(0.08);
const turtle = new Turtle();

function walk(i) {
    let y = -100 + i;
    for(let x = -100; x<100; x++)
    {
        if (Math.random()>0.1) {
            turtle.right(1);
        }
        turtle.penup();
        turtle.goto(x, y);
        turtle.pendown();
        turtle.forward(HEIGHT);
    }
    return i < 200;
}