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
line-moving-hearts.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
// Moving hearts
dot = display.circle(860, 100, 50)
dot.color = color.clear
dot.angle = random.num(0, 360)
dot2 = display.circle(100, 540, 50)
dot2.color = color.clear
dot2.position = { x: 100, y: 540 }
dot2.angle = random.num(0, 360)
line = display.line(dot.position, dot2.position)
line.style = "hearts"
line.width = 100
line.color = color.hsb(0, 95, 75)
line.borderColor = color.hsb(0, 75, 100)
line.borderWidth = 10
update(() => {
dot.move(10)
dot.ifOnEdgeBounce()
dot2.move(10)
dot2.ifOnEdgeBounce()
line.from(dot.position)
line.to(dot2.position)
})