How can I make a restart button??
I’ve tried with this code:
--------level1.lua------------
local restart=display.newImage("restart.png")
local function restartLevel(event)
if event.phase== "began" then
director:changeScene("level1")
end
end
restart:addEventListener("touch", restartLevel)
But this is really impossible. It doesn’t run. [import]uid: 27760 topic_id: 26071 reply_id: 326071[/import]