pTargetPercent = GetFloatParam("target", 0)

function init()
	target = FindBody("target")    
	targetSound = LoadSound("pickup.ogg")
	done = false
end

function tick(dt)
	if not done then
		local percentage = GetFloat("level.demolish.percentage")
		if percentage <= pTargetPercent then
            SetTag(target, "target", "cleared")
            PlaySound(targetSound)
			SetBool("level.complete",true)
            done = true
		end
	end
end
