From 1b67049ca60368a3347312cdfd7a95054699ec25 Mon Sep 17 00:00:00 2001 From: rebecca Date: Sat, 28 Feb 2026 21:13:36 +0000 Subject: grav --- grav.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 grav.lua 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 +) -- cgit v1.2.3