Lua - Corona SDK 如何解决这个问题或更改代码以使其正常工作?

Lua - Corona SDK How to fix this or change the code to make it work properly?

错误显示"more than 60 upvalues"

ball:addEventListener( "tap", function1 )
eggs:addEventListener( "tap", function2 )
dog:addEventListener( "tap", function3 )
car:addEventListener( "tap", function4 )
...
plane:addEventListener( "tap", function52 )

我已经对所有程序进行了编程。当我删除任何 20 行事件监听器应用程序时。因此,事件监听器可能存在限制。我不知道如何尽可能少地更改它。

我需要使用矩形作为听众的按钮。不像其他文章那样是变量。

而不是这样做:

function function1()
  print "tapped ball"
end
function function2()
  print "tapped eggs"
end
...
ball:addEventListener( "tap", function1 )
eggs:addEventListener( "tap", function2 )

尝试这样做:

ball:addEventListener( "tap", function()
  print("tapped ball")
end)
eggs:addEventListener( "tap", function()
  print("tapped eggs")
end)