-- song cave collectible

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

glow = 0

function init(me)
	commonInit(me, "Collectibles/goldstar", FLAG_COLLECTIBLE_STARFISH)
	entity_setEntityLayer(me, -3)
end

function update(me, dt)
	commonUpdate(me, dt)
	glow = createQuad("Naija/LightFormGlow", 13)
	quad_scale(glow, 5, 5)

	if glow ~= 0 then
		if entity_isInDarkness(me) then
			quad_alpha(glow, 1, 0.5)
		else
			quad_alpha(glow, 0, 0.5)
		end
	end
	
	quad_setPosition(glow, entity_getPosition(me))
	quad_delete(glow, 0.1)
	glow = 0
end

function enterState(me, state)
	commonEnterState(me, state)
	if entity_isState(me, STATE_COLLECTEDINHOUSE) then
		--createEntity("Walker", "", entity_x(me), entity_y(me))
	end	
end

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