xxxxxxxxxx
27
const risers = []
function setup () {
createCanvas (innerWidth, innerWidth)
}
function draw () {
background ('purple')
if (frameCount % 25 == 0 && risers.length < 8) {
risers.push (new Riser (innerWidth / 10, 200, color('tomato')))
}
risers.forEach (r => r.increment ())
risers.forEach (r => r.show ())
const third = width / 3
const half = width / 2
for (let i = 0; i < 256; i++) {
const period = i / 255
const y_pos = third + third * period
const angle = (period + (frameCount / 255)) * PI * 2
const x_pos = half + (third - 100) * sin (angle)
fill (i)
noStroke ()
ellipse (x_pos, y_pos, third)
}
}