Ok so in my game if you catch a certain amount of items then you get up to three stars. I am using the director class and I have a level “scene” and a menu “scene”. Now, I think, I know the basic idea of how I want to set it up… It would have a “stars.lua” file containing variables for each level and in each level, at the end of the level, it would tally up the score and change the variable on the “stars.lua” file.
The problem is I have no idea how to code this. I have the right code to open the .lua files. Like…
module(..., package.seeall)
function new()
local localGroup = display.newGroup()
--lots of code in between
return localGroup
end
But I don’t know how to change variables in a separate .lua file. Or maybe I’m completely looking at this the wrong way and if that is the case how would you go about it.
If you are so kind as to answer could you please provide some form of sample code and explain how they work. I’d like to learn as I go.
Thanks for taking the time to read it.
Danny [import]uid: 59140 topic_id: 17524 reply_id: 317524[/import]
[import]uid: 3826 topic_id: 17524 reply_id: 66587[/import]