i need help with this line(s) of code
function touchPLayBtn:tap( event )
transition.to(playBtn,{time=200, x=(display.contentWidth), y=(display.contentHeight), onComplete =function()
touchPlayBtn.isVisible = false
composer.gotoScene(“startgame”, {effect = “fade”, time=700})
})
return true
end
touchPLayBtn:addEventListener( “tap”, touchPLayBtn)
i have an arrow(playBtn) that flys off screen when touchd but i cant get it to do that with this code i need it to well if i press anywhere on the screen it still flys off i need it to only fly off when the arrow gets touched not the screen
here is the code that makes it fly off even if you touch anywhere on the screen
function touchPLayBtn(event)
if event.phase == “ended” then
transition.to(playBtn,{time=200, x=400, y=400})
composer.gotoScene(“startgame”, {effect = “fade”, time=700})
return true
end
end
Runtime:addEventListener(“touch”, touchPLayBtn)
thanks for you time and help.