Hey everyone,
I’m having a bear of a problem with the Director class and I am stumped!
I’m attempting to switch to a “credits” screen from my menu screen. then menu screen works to start the game but when the button to switch to the “credits” screen is tapped. I get the following error:
-----------------------
Director ERROR: Module 'credits' must have a new() function.
-----------------------
nil
-----------------------
I’m sure this is something simple that my exhausted brain is missing
here is the code for the credits.lua file
module(..., package.seeall)
function new()
local localGroup = display.newGroup();
local credits = display.newImage("credits.png");
credits.scene = "start";
localGroup:insert(credits);
function changeScene(e)
if(e.phase == "ended") then
director:changeScene(e.target.scene);
end
end
credits:addEventListener("touch", changeScene)
return localGroup;
end
Thanks for the help. [import]uid: 10763 topic_id: 17066 reply_id: 317066[/import]
