restart button

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]

Did you accidentally post this before finishing it?

Your last line seems to be the start of a question but it isn’t clear what you want to know.

What’s the problem? :slight_smile: [import]uid: 52491 topic_id: 9504 reply_id: 34742[/import]