summaryrefslogtreecommitdiff
path: root/examples/noc/test/noise_walker.reload.script
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 21:28:20 -0300
committerGabriel Schneider <[email protected]>2026-11-16 21:28:20 -0300
commit6933f99ddb2d7103515d26838496309a807bba26 (patch)
tree991c2fe7d4a57957222876e190fa4d16a0fb889c /examples/noc/test/noise_walker.reload.script
parent82fca5c9f29124f37f6dcd08e73e6999ce44a69d (diff)
downloadsketchbook-6933f99ddb2d7103515d26838496309a807bba26.tar.gz
sketchbook-6933f99ddb2d7103515d26838496309a807bba26.zip
Move standalone sketches into sketchbook examples
Diffstat (limited to 'examples/noc/test/noise_walker.reload.script')
-rw-r--r--examples/noc/test/noise_walker.reload.script31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/noc/test/noise_walker.reload.script b/examples/noc/test/noise_walker.reload.script
new file mode 100644
index 0000000..a426f3b
--- /dev/null
+++ b/examples/noc/test/noise_walker.reload.script
@@ -0,0 +1,31 @@
+# Live reload (design.md "Acceptance: live reload"): play a while, pause a
+# replay so State holds still, load the edited build ({v2}: a light gray
+# circle), check that State carried over and the picture changed where the edit shows.
+# The reload jumps (`in.jumped`), so the whole trail is repainted light.
+frames 120
+console record 0
+frames 30
+console stop
+console play 0
+frames 10
+console pause
+frames 2
+expect walker.x 343.033 ~0.001
+expect walker.y 75.677 ~0.001
+expect clock.count 130
+screenshot .zig-cache/e2e/noise_walker-before.png
+frames 1
+load {v2}
+expect walker.x 343.033 ~0.001
+expect walker.y 75.677 ~0.001
+expect clock.count 130
+# Playing on: the steps after the reload are drawn by the new code.
+console pause
+frames 10
+expect walker.x 340.456 ~0.001
+expect walker.y 79.168 ~0.001
+expect clock.count 140
+screenshot .zig-cache/e2e/noise_walker-after.png
+frames 1
+expect-different-screenshot .zig-cache/e2e/noise_walker-before.png .zig-cache/e2e/noise_walker-after.png
+expect-pixel .zig-cache/e2e/noise_walker-after.png 340 79 220 220 220 255