触摸事件:当触摸图像时调用函数并移除图像。

我在我的游戏中使用触摸事件函数。当触摸到图片时,它会调用函数,同时也必须删除该图片。请帮帮我,朋友们。

代码:

local img=display.newImageRect("bingo.png",451,369)
function img:touch( event )
if event.phase == "began" then

    newgame()
end
    return true
end
img:addEventListener( "touch", img )
点赞