I tried to make something that allows you to reset your game. I tried to make it but the button would not reset. No error message in console
resetButton = display.newImage("image/reset.png")
resetButton.x = 300
resetButton.y = 512
resetButton.isVisible = false
resetButton.alpha = 0
resetButton.scene = "menu"
function changeScene(e)
if(e.phase == "ended") then
director:changeScene(e.target.scene)
end
end
resetButton:addEventListener("touch", changeScene)
local onCollision = function (self, event)
if event.phase == "began" then
if event.other.name == "spikes" then
resetButton.isVisible = true
transition.to(resetButton, {time=500, alpha = 1})
self:removeSelf()
self = nil
end
end
end
that is my code. How would I make the reset work. I am trying tutoials but nting is wokring [import]uid: 55737 topic_id: 10044 reply_id: 310044[/import]