Ive got this function that spawns objects and a timer that replays this function 5 times (so 5 of the same object show up).
When i touch one of the objects, i want to remove the object and leave a ‘splat’ or a mark where it was removed. I’ve tried this but when there are two of the objects on the screen, the mark gets left on the other object and not the one that I touched.
(the boxes are moving around)
So how can i display a mark on the coordinates of each box after it is removed (even when there are multiple boxes on the screen).
Thanks in advance 
Heres my code:
[code]
local box_x
local box_y
function box:touch(e)
if (e.phase == “ended”) then
–coordinates of box
box_x = box.x
box_y = box.y
–calls the function that holds the instructions
whenTouch(self)
end
end
box:addEventListener(“touch”, box)
function whenTouch(obj)
–displays the mark or ‘splat’ at the box’s coordinates
mark = display.newImage(“ball.png”, box_x, box_y)
–removes box
obj:removeSelf()
end [import]uid: 86598 topic_id: 14393 reply_id: 314393[/import]