ludus-scripts/mattspingon.ld

29 lines
632 B
Plaintext

let numgons = 10
fn ngon! (sides, size) -> repeat sides { fd!(size); lt!(inv(sides)) }
let cpal = [(100,255,100,100),(80,100,200,170),(80,100,200,70),(250,80,100,170)]
fn spingon! (sides, size, count, pw, alpha, turn, move) -> {
if eq? (count, 0) then {
"enough!"
} else {
rt!(inv(sides))
pencolor!((100,180,100,alpha))
pw!(pw)
ngon! (sides, size)
rt!(turn)
fd!(move)
spingon! (
add(sides, 3),
inc(size),
dec(count),
add(pw, 0.0005),
add(alpha, div(255, numgons)),
turn,
move)
}
}
spingon!(3, 1, numgons, 1, 1, 0.3, 70)