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/flappy_bird.script | |
| parent | 82fca5c9f29124f37f6dcd08e73e6999ce44a69d (diff) | |
| download | sketchbook-6933f99ddb2d7103515d26838496309a807bba26.tar.gz sketchbook-6933f99ddb2d7103515d26838496309a807bba26.zip | |
Move standalone sketches into sketchbook examples
Diffstat (limited to 'examples/noc/test/flappy_bird.script')
| -rw-r--r-- | examples/noc/test/flappy_bird.script | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/examples/noc/test/flappy_bird.script b/examples/noc/test/flappy_bird.script new file mode 100644 index 0000000..8289848 --- /dev/null +++ b/examples/noc/test/flappy_bird.script @@ -0,0 +1,94 @@ +# The bird falls; space (or a click) flaps. Pipes come every 100 steps +# from the right; passing one scores. The script flaps whenever the bird +# is down to about 295, which takes it through the first two gaps (the +# first is 237..337), then lets it drop: past one more pipe, onto the next. +# The round ends ("OOPS!"), nothing moves, and a click starts the next +# round, keeping the best score. +expect pipes.buffer[0].top 236.904 ~0.001 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +await bird.y 295 ~10 +key space +frames 8 +expect score 2 +expect over false +screenshot .zig-cache/e2e/flappy_bird.png +await over true +expect score 3 +expect best 3 +frames 30 +expect over true +screenshot .zig-cache/e2e/flappy_bird-over.png +click 320 180 +expect over false +expect score 0 +expect best 3 +expect pipes.len 1 +expect bird.y 120 |
