-- song cave collectible

dofile("scripts/include/collectibletemplate.lua")

function init(me)
	commonInit(me, "Collectibles/NaijaCave", FLAG_COLLECTIBLE_NAIJACAVE)
end

function update(me, dt)
	commonUpdate(me, dt)
end

function enterState(me, state)
	commonEnterState(me, state)
	if entity_isState(me, STATE_COLLECTEDINHOUSE) then
		-- spawn a bunch o' plants
		node = getNodeByName("PLANT1")
		ent = createEntity("SongStalk", "", node_x(node), node_y(node))
		entity_rotate(ent, -45)
		node = getNodeByName("PLANT2")
		ent = createEntity("Phonograph", "", node_x(node), node_y(node))		
		entity_rotate(ent, -45)
		setElementLayerVisible(7, true)
	end
end

function exitState(me, state)
	commonExitState(me, state)
end
