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
platforms.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
display.color = color.hsb(0,0,0,10);
[
[250, 150, 600, 15],
[710, 275, 600, 15],
[250, 400, 600, 15],
[710, 525, 600, 15]
].each((ar, i) => {
let f = display.rect(...ar)
f.angle = (i == 1 || i == 3) ? -15 : 15
f.color = color.clear
let ang = ((f.y / display.height * 360) + 180) % 360
f.borderColor = color.hsb(f.y / display.height * 360, 55, 95)
f.borderWidth = 0.25
physics.add(f, { static: true })
})
repeat(200, () => {
let c = display.circle(100, 50, 5)
c.color = color.hsb(0, 55, 95)
physics.add(c, { friction: 0.5, bounce: 0.7, density: 1 })
})
update(() => {
display.each("circle", (el) => {
el.ifOnEdgeContinue()
el.color.hue = el.y / display.height * 360
})
})