aboutsummaryrefslogtreecommitdiffstats
path: root/examples/steps.aup
diff options
context:
space:
mode:
Diffstat (limited to 'examples/steps.aup')
-rw-r--r--examples/steps.aup24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/steps.aup b/examples/steps.aup
new file mode 100644
index 0000000..ee4eb47
--- /dev/null
+++ b/examples/steps.aup
@@ -0,0 +1,24 @@
+# if / else and else if; the first matching branch runs.
+state level = 0
+state band = 0
+input up = key ArrowUp
+input down = key ArrowDown
+view shown = band
+
+on up.down {
+ level = level + 1
+}
+
+on down.down {
+ level = level - 1
+}
+
+on frame {
+ if level > 2 {
+ band = 2
+ } else if level > 0 {
+ band = 1
+ } else {
+ band = 0
+ }
+}