diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 21:28:20 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-16 21:28:20 -0300 |
| commit | 6933f99ddb2d7103515d26838496309a807bba26 (patch) | |
| tree | 991c2fe7d4a57957222876e190fa4d16a0fb889c /examples/noc/test/smoke.script | |
| parent | 82fca5c9f29124f37f6dcd08e73e6999ce44a69d (diff) | |
| download | sketchbook-6933f99ddb2d7103515d26838496309a807bba26.tar.gz sketchbook-6933f99ddb2d7103515d26838496309a807bba26.zip | |
Move standalone sketches into sketchbook examples
Diffstat (limited to 'examples/noc/test/smoke.script')
| -rw-r--r-- | examples/noc/test/smoke.script | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/noc/test/smoke.script b/examples/noc/test/smoke.script new file mode 100644 index 0000000..93262c9 --- /dev/null +++ b/examples/noc/test/smoke.script @@ -0,0 +1,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 |
