summaryrefslogtreecommitdiff
path: root/grav.lua
blob: 5f0f0bd078eadd88453dba913d67102019eb6968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
)