examples
_animations
- animating-circles.js
- circle-grid.js
- circles-border-timer.js
- circles-inout.js
- circles.js
- cloud-delay.js
- clown.js
- drops.js
- grid.js
- helloworld-animate.js
- keyframe.js
- shapes-border.js
- square-grid.js
- squares-border-timer.js
- squares-timer-overlap.js
- troll.js
- circles2.js
- helloworld-animate2.js
- keyframe2.js
- keyframe3.js
_audio
_gravity
_particles
_sub
display
movement
- arrows-aim-shoot.js
- arrows-line.js
- arrows-rotate.js
- arrows-shift.js
- arrows-x.js
- arrows-y.js
- drag-drop.js
- falling-click.js
- follow-line.js
- follow-x.js
- follow-y.js
- follow.js
- if-on-edge-bounce.js
- input-aim-shoot.js
- input-point-goto.js
- input-point-moveto.js
- joystick.js
- strech-back-release-physics.js
- stretch-front-release-physics.js
- stretch-front-release.js
- drag-drop2.js
physics
showcase
tests
user-interface
grid.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
world.frame()
lbl = ui.button("Firebox🔥")
lbl.font = "Monaco"
lbl.fontSize = 35
lbl.cornerRadius = 5
lbl.borderWidth = 2
lbl.action(() => {
physics.add(lbl)
display.each("circle", (elem) => elem.moveImpulse(15))
})
repeat(30, () => {
let c = display.circle(display.width/2, display.height - 100, 20)
physics.add(c)
let col = color.hsb(random.num(0,360), 42, 92)
c.color = col.darker(3)
c.borderColor = col.lighter(3)
c.borderWidth = 4
c.moveToFront()
c.click((e) => {
c.angle = c.angleTo({ position: e.position })
c.moveImpulse(15)
})
})
numx = 5
size = display.width / numx
numy = Math.ceil(display.height / numx / size * numx)
times(numy, (y) => {
times(numx, (x) => {
let r = display.rect(
(x*size)+size/2,
(y*size)+size/2,
size,
size
)
r.color = color.hsb(random.num(0,360), 42, 92)
})
})