Input layer
authorAlyssa Rosenzweig <alyssa@backtick.town>
Sat, 2 Jul 2016 17:35:40 +0000 (10:35 -0700)
committerAlyssa Rosenzweig <alyssa@backtick.town>
Sat, 2 Jul 2016 17:35:40 +0000 (10:35 -0700)
src/Input/input.tosh [new file with mode: 0644]

diff --git a/src/Input/input.tosh b/src/Input/input.tosh
new file mode 100644 (file)
index 0000000..fac963b
--- /dev/null
@@ -0,0 +1,19 @@
+define read controller 0
+set M to item 1 of controller 1 state * 1
+delete 1 of controller 1 state
+
+define controller strobe (value)
+if controller strobe = 1 and value = 0 then
+    delete all of controller 1 state
+    add <key z pressed?> to controller 1 state
+    add <key x pressed?> to controller 1 state
+    add <key s pressed?> to controller 1 state
+    add <key space pressed?> to controller 1 state
+    add <key up arrow pressed?> to controller 1 state
+    add <key down arrow pressed?> to controller 1 state
+    add <key left arrow pressed?> to controller 1 state
+    add <key right arrow pressed?> to controller 1 state
+    set controller strobe to value
+else
+    set controller strobe to value
+end
This page took 0.03373 seconds and 4 git commands to generate.