This do_later seems to be getting called twice! (the print happens twice) even though the object is dead!
function kill(obj)
table.remove(obj.obj_table,obj.index)
obj:removeSelf()
obj = nil
end
For the record my kill routine.
I can’t see an issue here but Corona spouts: “ERROR: Attempt to remove an object that’s already been removed from the stage or whose parent/ancestor group has already been removed.”
Presumably there’s something I don’t understand or have missed so any help as always appreciated
First, I don’t know how useful putting both a touch and tap listener on the same object (in this case the Runtime) will be. Tap is a specialized touch handler that simplifies doing it with touch. Touch events are going to send both a began and ended phase, so if you’re not testing for the phase, you’re going to end up doing things twice.
As for “originalCoronaRemoveSelf”, not sure what you’re doing there trying to override our removeSelf, but that error is indicating that it’s expecting that perhaps you’re not calling it with the :removeSelf, but .removeSelf… or something similar.
First, I don’t know how useful putting both a touch and tap listener on the same object (in this case the Runtime) will be. Tap is a specialized touch handler that simplifies doing it with touch. Touch events are going to send both a began and ended phase, so if you’re not testing for the phase, you’re going to end up doing things twice.
As for “originalCoronaRemoveSelf”, not sure what you’re doing there trying to override our removeSelf, but that error is indicating that it’s expecting that perhaps you’re not calling it with the :removeSelf, but .removeSelf… or something similar.