Hi,
I have a tap listener which will be added to multiple sprites, as a form of level selection.
When one is tapped how can I tell which sprite it is?
I don’t want individual listeners for each level.
Whats the best way to do this?
Thanks
local function changeLevel(event)
print( "level selected but which one??")
end
for i=1,12 do
levels[i] = display.newImage("level.png", x, y)
levels[i]:addEventListener("tap", changeLevel)
end
[import]uid: 38562 topic_id: 8596 reply_id: 308596[/import]
[import]uid: 38562 topic_id: 8596 reply_id: 30910[/import]