1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
display.color=color.hsb(0,0,0,5)
let grv = display.circle(display.center, 100)
grv.color = color.clear
grv.tag = "gravity"
input.point((e) => {
grv.position = e.position
})
times(1000, () => {
let orb = display.circle(480, 100, 1)
orb.velocity = Vec2(random.num(0,1) * 5, random.num(-1, 1))
orb.color = color.hsb(random.num(0,360), 75, 95)
})
update(() => {
display.each("circle", (el) => {
grv.applyGravity(el)
})
})
display.color=color.hsb(0,0,0,5)
let grv = display.circle(display.center, 100)
grv.color = color.clear
grv.tag = "gravity"
input.point((e) => {
grv.position = e.position
})
times(1000, () => {
let orb = display.circle(480, 100, 1)
orb.velocity = Vec2(random.num(0,1) * 5, random.num(-1, 1))
orb.color = color.hsb(random.num(0,360), 75, 95)
})
update(() => {
display.each("circle", (el) => {
grv.applyGravity(el)
})
})