Delete object[i] from table or group in corona sdk
- by Rober Dote
i have a problem (obviusly :P)
i'm create a mini game, and when i touch a Object-A , creates an Object-B.
If i touch N times, this create N Object-B.
(Object-B are Bubbles in my game)
so, i try when I touch the bubble (object-B), that disappears or perform any actions.
I try adding Object-B to Array
local t = {}
.
.
.
bur = display.newImage("burbuja.png")
table.insert(t,bur)
and where i have my eventListeners i wrote:
for i=1, #t do
bur[i]:addEventListener("tap",reventar(i))
end
and my function 'reventar'
local function reventar (event,id)
table.remove(t,id)
end
i'm lost, and only i want disappears the bubbles.