情况是我需要访问调用eventListener
的对象例如:
如果我要添加:balls[ball]:addEventListener( "collision", removeBricks)
如何在removeBricks函数中访问balls[ball]
?
function removeBricks(event)
print("caller: " .. balls[ball])
...
end
balls[ball]:addEventListener( "collision", removeBricks)
我尝试了什么:
balls["ball"]:addEventListener( "collision", removeBricks(event, balls["ball"]))
答案 0 :(得分:0)
self -> balls[ball]
event.other -> other collided object