function init()	
	switch = FindShape("switch")
	lamp = FindLight("lamp")

	on = false
	SetLightEnabled(lamp, false)
	SetTag(switch, "interact", "loc@TURN_ON")

	onSound = LoadSound("screen-on.ogg")
	offSound = LoadSound("screen-off.ogg")
end


function tick()
	if GetPlayerInteractShape() == switch and InputPressed("interact") then

		if on then
			on = false
			PlaySound(offSound)
			SetLightEnabled(lamp, false)
			SetTag(switch, "interact", "loc@TURN_ON")
		else
			on = true
			PlaySound(onSound)
			SetLightEnabled(lamp, true)
			SetTag(switch, "interact", "loc@TURN_OFF")
		end
		
	end
end

