In my game, enemies are constantly spawning at a rate of 1 per 2 seconds, and all going into a table. When one is tapped, I want only this one to go away.
I tried
function destroy(obj)
obj:removeSelf()
end
function ship:hit(e)
f = “200”
if f < freq1 + 20 and f > freq1 - 20 or f < top1 + 20 and f > top1 - 20 then
destroy(self)
print(“hit”)
return true;
end
end
Runtime:addEventListener(“enterFrame”, hit)
I get assertion failed errors. [import]uid: 59735 topic_id: 20113 reply_id: 320113[/import]