examples

drops.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
display.color = color.hsb(0, 5, 12)

timer.every(250, () => {
  let cir = display.circle(random.pos(), 5)
  cir.color = color.clear
  cir.borderWidth = 2
  cir.borderColor = color.hsb(random.num(0, 360), 75, 92)
})

update(() => {
  display.each("circle", (elem) => {
    elem.radius += 2
    if (elem.radius > 240) {
      elem.animate(100, (to) => {
        to.alpha = 0
      }, () => {
        elem.destroy()
      })
    }
  })
})