1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
display.color=color.hsb(0,0,0,10)
lbl = ui.label("Click anywhere!")
input.point((e) => {
if (e.began) {
lbl.destroy()
let grv = display.circle(e.position, 50)
grv.color = color.clear
grv.tag = "gravity"
}
})
times(1000, () => {
let orb = display.circle(display.width / 2, 100, 4)
orb.velocity = Vec2(2, random.num(-1, 1) * 2)
orb.color = color.hsb(random.num(0,360), 75, 95)
})
update(() => {
display.each("gravity", (grv) => {
display.each("circle", (el) => {
grv.applyGravity(el)
})
})
})
display.color=color.hsb(0,0,0,10)
lbl = ui.label("Click anywhere!")
input.point((e) => {
if (e.began) {
lbl.destroy()
let grv = display.circle(e.position, 50)
grv.color = color.clear
grv.tag = "gravity"
}
})
times(1000, () => {
let orb = display.circle(display.width / 2, 100, 4)
orb.velocity = Vec2(2, random.num(-1, 1) * 2)
orb.color = color.hsb(random.num(0,360), 75, 95)
})
update(() => {
display.each("gravity", (grv) => {
display.each("circle", (el) => {
grv.applyGravity(el)
})
})
})