Alexander Deplov

Random curves animated

Random curves animated

Code

var bg = new Path.Rectangle({
    size: view.bounds,
    fillColor: 'black',
    position: view.center
})
var group = new Group()

function createPath() {
    var path = new Path();
    path.strokeWidth = 4
    path.strokeColor = 'black';
    path.add(view.center)
    for (var i = 0; i < 120; i++) {
        var vector = new Point({
            angle: Math.sin(i * Math.random() * 26) * i,
            length: i / 1
        })
        path.lineBy(vector)
    }
    path.strokeColor = Color.random()
    path.smooth({
        type: 'continuous'
    })
    path.position.x = 0
    group.addChild(path)
}
createPath()

function onFrame(event) {
    if (event.count % 10 == 0) {
        createPath()
    }
    if (group.children.length >= 20) {
        group.children[0].remove()
    }
}