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
camera-input-follow.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
43
44
45
46
47
48
49
50
51
52
53
54
55
world.setBounds(0, 0, 1920, 1240)
pl = display.emoji("🤩", 1820, 1140)
pl.pointTo({ position: { x: 1820, y: 540 } })
pl.update(() => {
pl.pointTo(input)
pl.move(10)
})
app.clicked((elem) => {
print("clicked", elem)
})
camera.follow(pl)
input.left(() => {
pl.rotate(-2)
})
input.right(() => {
pl.rotate(2)
})
input.up(() => {
pl.move(5)
})
for (var i = 75; i < world.width; i += (192)) {
display.emoji("🔥", i, Math.sin(i / world.width) * world.height)
}
display.rect(
(world.x + display.width / 2),
(world.y + display.height / 2),
100,
100
)
display.rect(
(world.width - display.width / 2),
(world.y + display.height / 2),
100,
100)
display.rect(
(world.width - display.width / 2),
(world.height - display.height / 2),
100,
100
)
display.rect(
(world.x + display.width / 2),
(world.height - display.height / 2),
100,
100
)