I am done building my game! or almost, I have a problem that is bugging the heck out of my body. So I want to make a reset button when the balloon hits the floor. Well I got the onCollision to work
local onCollision = function (self, event)
if event.phase == "began" then
if event.other.name == "spikes" then
local gameoverText = display.newText("Game Over!", 0, 0, "HelveticaNeue", 35)
gameoverText:setTextColor(255, 255, 255)
gameoverText.x = display.contentCenterX
gameoverText.y = display.contentCenterY
self:removeSelf()
self = nil
end
end
end
but when I put in the onCollision function a button and set it so the director will change scenes to the game it spits out an error. Any help? [import]uid: 55737 topic_id: 9496 reply_id: 309496[/import]
[import]uid: 12455 topic_id: 9496 reply_id: 34717[/import]