I keep getting errors when I try to reload the same scene that I’m on. For instance, if I was playing my game on Level1, I would make an event listener that would changeScene to Level1. It doesn’t do anything, just sits there. Anyone know how to make a retry button. I desperately need to know. Thanks
Here is some example code so you can see what im trying to do.
[lua]local retry = ui.newButton{
default = “retry.png”,
over = “retryin.png”,
}
retry.x = _W/1.6; retry.y = _H/2;
retry.xScale = .7; retry.yScale = .7;
localGroup2:insert(retry)
retry.scene = “level1”
retry:addEventListener(“touch”, changeScene)
----------------Change Scene Director Class Code-----------------------------------
function changeScene(e)
if(e.phase == “ended”) then
director:changeScene(e.target.scene);
end
end[/lua] [import]uid: 29181 topic_id: 9423 reply_id: 309423[/import]