summaryrefslogtreecommitdiff
path: root/examples/noc/test/bin_lattice.script
blob: e0d03ac997f19506629253688d0d24adeb80a270 (plain) (blame)
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
# 2000 boids start at random places and gather into flocks. Each looks only
# at the boids binned in its own and the 8 surrounding 40-pixel cells: the
# grid in State holds every boid once, in cell order. A drag adds one boid
# per pointer move while the button is down (mouseDragged).
frames 3
expect boids.len 2000
expect grid.start[0] 0
expect grid.start[144] 2000
frames 117
expect clock.count 119
expect boids.buffer[0].position[0] 87.396 ~0.01
expect boids.buffer[0].position[1] 160.950 ~0.01
expect boids.buffer[1999].position[0] 336.283 ~0.01
# The top-left cell is empty now; boid 207 is the first in cell order.
expect grid.start[1] 0
expect grid.order[0] 207
down 100 300
move 110 300
move 120 300
move 130 300
up 130 300
expect boids.len 2003
# The last one was added at (130, 300) and has flown a step since.
expect boids.buffer[2002].position[0] 131.087 ~0.01
move 200 200
expect boids.len 2003
frames 1
expect grid.start[144] 2003
# The pointer's 3x3 cells are shaded.
move 300 200
frames 60
screenshot .zig-cache/e2e/bin_lattice.png