:NAME notification


:PARAM float32 duration

:VAR c_sound* sound_close


-- ------------------- initialization ------------------- 

-- remember 1 = open, 0 = closed

function param_initialize(p)
	p.duration= 4
end

function var_initialize(v)
	-- nothing
end

-- ------------------- component ------------------- 

function attach(object)
end

function update(object)	
	local input= object.input_get()
	local dismiss= false
	if (input and input.touch_started()) then
		dismiss= true
	else
		local time= object.object_time_get()
		local dt= time - object.placement_time
		
		if (dt > param.duration) then
			dismiss= true
		end
	end
	
	if (dismiss) then
		object.tween_animation_play("end")
		sleep()
	end
end

component_register(attach, update, nil, nil)
