I want to be able to restart my game when someone clicks a button.
local onCollision = function (self, event)
if event.phase == "began" then
if event.other.name == "spikes" then
self:removeSelf()
self = nil
end
end
end
So within that class I want to be able to show a gameover image(have that) and when you press it it will reset the game. I tried
local function resetButton()
director:changeScene("loading")
end
and then withen in
[import]uid: 55737 topic_id: 9504 reply_id: 309504[/import]