diff options
Diffstat (limited to 'grav.lua')
| -rw-r--r-- | grav.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2,7 +2,8 @@ local p = peripheral.wrap"back" assert(p.hasModule"plethora:kinetic", "need kinetic!") assert(p.hasModule"plethora:glasses", "need glasses!") -local strength = 0.5 +local strength = 0.2 +local delta = 0.01 local canvas = p.canvas() local text = canvas.addText({x=5,y=5}, "..") @@ -15,8 +16,8 @@ parallel.waitForAny( 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 + if key == 265 then strength=strength+delta + elseif key == 264 then strength=strength-delta end strength = math.min(strength, 4) strength = math.max(strength, 0) end end |
