dofile("scripts/entities/entityinclude.lua")

running = false
t = 12

function init(me)
	--node_setCursorActivation(me, true)
	loadSound("kathunk")
end
	
function activate(me)
	if running then return end
	
	playSfx("kathunk")
	running = true
	lvl = node_y(me)
	if (getWaterLevel() ~= lvl) then
		setFlag(FLAG_SUNTEMPLE_WATERLEVEL, 0)
		setWaterLevel(lvl, t)
	else
		node = getNode("SUNTEMPLE_GEAR2")
		setWaterLevel(node_y(node), t)
		setFlag(FLAG_SUNTEMPLE_WATERLEVEL, 1)
	end
	--[[
	n = getNaija()
	
	x = entity_x(n)	
	cam_toEntity(0)
	entity_idle(n)
	while (getWaterLevel() ~= lvl) do
		watch(FRAME_TIME)
		cam_setPosition(x, getWaterLevel(), 0)
	end
	cam_toEntity(n)
	]]--
	running = false
end

function update(me, dt)
end
