summaryrefslogtreecommitdiff
path: root/grav.lua
diff options
context:
space:
mode:
Diffstat (limited to 'grav.lua')
-rw-r--r--grav.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/grav.lua b/grav.lua
new file mode 100644
index 0000000..5f0f0bd
--- /dev/null
+++ b/grav.lua
@@ -0,0 +1,21 @@
+local p = peripheral.wrap"back"
+assert(p.hasModule"plethora:kinetic", "need kinetic!")
+assert(p.hasModule"plethora:glasses", "need glasses!")
+
+local strength = 0.5
+
+local canvas = p.canvas()
+local text = canvas.addText({x=5,y=5}, "..")
+text.setScale(3)
+
+parallel.waitForAny(
+ function() while true do
+ p.launch(0,-90,strength)
+ end end,
+ function() while true do
+ text.setText(tostring(strength))
+ local _,key = os.pullEvent"key"
+ if key == 265 then strength=strength+0.1
+ elseif key == 264 then strength=strength-0.1 end
+ end end
+)