diff options
Diffstat (limited to 'examples/toggle.aup')
| -rw-r--r-- | examples/toggle.aup | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/toggle.aup b/examples/toggle.aup new file mode 100644 index 0000000..39417cc --- /dev/null +++ b/examples/toggle.aup @@ -0,0 +1,20 @@ +# Space toggles visibility; Right arrow moves a position that wraps. +state visible = 1 +state position = 120 +input toggle = key Space +input move = key ArrowRight +view marker_x = position +view marker_radius = visible * 24 +view tile_x = position - 24 +view value = visible + +on toggle.down { + visible = !visible +} + +on move.down { + position = position + 40 + if position > 560 { + position = 80 + } +} |
