在下载的程序中,有个地方没怎么看懂。求教。 在setup中声明了一个表 touches={} --用来保留touch的表 在touch函数是这样的 function touched(touch) if touch.state==ENDED then touches[touch.id]=nil else touches[touch.id]=touch end end 这一段的问题是:touch.id是触摸事件的标识符,是一个整数型变量。 我用print的方式,查看了下,这个touch.id是一个很大的整数变量。 我搞不懂这样赋值的含义是什么? 这个touches主要在draw函数用到,用于检测是否双击屏幕 for k,touch in pairs(touches) do if touch.tapCount ==2 then initialise() gatestate=PLAY end end 这一段的问题就是touches这个表中,应该只有touches[touch.id]里面有只才对。为啥不是 if touch[touch.id].tapCount==2呢? 在游戏中,用于检测屏幕触摸状态是 if CurrentTouch==MOVING or CurrentTouch==BEGAN then ..... 这个问题是一般你们怎么来使用Touch和CurrentTouch?