summaryrefslogtreecommitdiff
path: root/examples/noc/test/smoke.script
blob: 93262c97686611ebc8c522d7b19de947f68f0cb2 (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
# The pointer at three quarters of the width: a wind of 0.1 to the right.
move 480 200
frames 120
expect wind 0.1 ~0.000001
# One particle a step, each living 51 steps; the wind piles into the
# oldest one's velocity.
expect particles.len 51
expect particles.buffer[0].lifespan 0
expect particles.buffer[0].position[0] 480.606 ~0.01
expect particles.buffer[0].velocity[0] 5.662 ~0.01
screenshot .zig-cache/e2e/smoke.png
frames 1
# The arrow: a 1 px line between rows 49 and 50, half on each.
expect-pixel .zig-cache/e2e/smoke.png 340 49 127 127 127 255 2
expect-pixel .zig-cache/e2e/smoke.png 340 50 127 127 127 255 2
expect-pixel .zig-cache/e2e/smoke.png 300 49 0 0 0 255
# Faint smoke, densest at the emitter, drifting right; black elsewhere.
expect-pixel .zig-cache/e2e/smoke.png 320 285 244 244 244 255 3
expect-pixel .zig-cache/e2e/smoke.png 360 240 54 54 54 255 3
expect-pixel .zig-cache/e2e/smoke.png 100 100 0 0 0 255
# The wind to the left: the arrow turns round.
move 160 200
frames 2
expect wind -0.1 ~0.000001
screenshot .zig-cache/e2e/smoke-left.png
frames 1
expect-pixel .zig-cache/e2e/smoke-left.png 300 49 127 127 127 255 2
expect-pixel .zig-cache/e2e/smoke-left.png 340 49 0 0 0 255